示例#1
0
文件: KwsCoreOp.cs 项目: tmbx/kwm-ng
        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);
            }
        }
示例#2
0
文件: KwsCoreOp.cs 项目: tmbx/kwm-ng
        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);
            }
        }
示例#3
0
文件: WmEAnp.cs 项目: tmbx/kwm-ng
        /// <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);
        }
示例#4
0
文件: WmEAnp.cs 项目: tmbx/kwm-ng
        /// <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);
        }
示例#5
0
文件: KwsCoreOp.cs 项目: tmbx/kwm-ng
 protected override void PrepareStart()
 {
     Kws = Wm.GetKwsByInternalIDOrThrow(KwsId);
 }