Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteDesktopWinFormsControl"/> class.
        /// </summary>
        public RemoteDesktopWinFormsControl()
        {
            InitializeComponent();

            mServiceConfig = new DescriptionResponseArgs(pbClient.Size, Size.Empty, new CursorInfo[] { }, false);
            DrawInitialBlackBackground();
        }
Example #2
0
        public LoginResponseStateEnum Login(string username, string password)
        {
            if (!IsConnected)
            {
                throw new InvalidOperationException("Client was not connected.");
            }

            LoginResponseArgs      response = mProxy.Login(new LoginRequestArgs(username, password));
            LoginResponseStateEnum result   = LoginResponseStateEnum.AccessDenied;

            if (response != null)
            {
                result = response.ResponseState;
                if (result == LoginResponseStateEnum.AccessGranted)
                {
                    mProxy.IsAuthenticated = true;
                    mServiceConfig         = mProxy.ClientGetConfiguration();
                    mCursorWithIds.Clear();
                    foreach (CursorInfo info in mServiceConfig.Cursors)
                    {
                        mCursorWithIds[info.CursorId] = info.Cursor;
                    }
                    pbClient.Size = mServiceConfig.DesktopSize;
                    DrawInitialBlackBackground();
                }
            }
            return(result);
        }