Beispiel #1
0
        public override void Start()
        {
            try
            {
                // Register to the workspace, if possible.
                Kws = Wm.GetKwsByInternalIDOrThrow(KwsID);
                RegisterToKws();
                Kws.KcdLoginHandler.OnSetLoginPwdRefused += OnLoginPwdRefused;

                // The password was "accepted" without being tried.
                if (!Kws.KcdLoginHandler.SetLoginPwd(Pwd))
                {
                    Complete();
                    return;
                }

                // Wait to be notified. Either we will be told that the
                // password was refused or the login status will change.
            }

            catch (Exception ex)
            {
                HandleFailure(ex);
            }
        }
Beispiel #2
0
        public override void Start()
        {
            try
            {
                // Get the workspace, if possible.
                Kws = Wm.GetKwsByInternalIDOrThrow(KwsID);

                // If the task is delete remotely, start a delete remotely
                // operation.
                if (Task == KwsTask.DeleteRemotely)
                {
                    m_deleteRemotelyOp               = new KwsCoreOpDeleteKwsRemotely();
                    m_deleteRemotelyOp.Kws           = Kws;
                    m_deleteRemotelyOp.OnCompletion += OnDeleteRemotelyCompletion;
                    m_deleteRemotelyOp.Start();
                }

                // Perform the task switch right away.
                else
                {
                    Kws.Sm.RequestTaskSwitch(Task);
                }
            }

            catch (Exception ex)
            {
                HandleFailure(ex);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Join a VNC session.
        /// </summary>
        private void HandleVncJoinSession(AnpMsg cmd, AnpMsg res)
        {
            int       i         = 0;
            UInt64    kwsID     = cmd.Elements[i++].UInt64;
            UInt64    sessionID = cmd.Elements[i++].UInt64;
            String    subject   = cmd.Elements[i++].String;
            Workspace kws       = Wm.GetKwsByInternalIDOrThrow(kwsID);

            byte[] sessionUuid = kws.Vnc.StartClientSession(sessionID, subject);
            res.Type = (uint)EAnpRes.VncSession;
            res.AddBin(sessionUuid);
        }
Beispiel #4
0
        /// <summary>
        /// Create a VNC session.
        /// </summary>
        private void HandleVncCreateSession(AnpMsg cmd, AnpMsg res)
        {
            int       i           = 0;
            UInt64    kwsID       = cmd.Elements[i++].UInt64;
            bool      supportFlag = cmd.Elements[i++].UInt32 > 0;
            String    subject     = cmd.Elements[i++].String;
            Workspace kws         = Wm.GetKwsByInternalIDOrThrow(kwsID);

            byte[] sessionUuid = kws.Vnc.StartServerSession(supportFlag, 0, subject);
            res.Type = (uint)EAnpRes.VncSession;
            res.AddBin(sessionUuid);
        }
Beispiel #5
0
 protected override void PrepareStart()
 {
     Kws = Wm.GetKwsByInternalIDOrThrow(KwsId);
 }