public override void Start() { try { // Prepare to start. PrepareStart(); // Register to the workspace. RegisterToKws(); // Make sure the workspace is logged in. if (Kws.Cd.KcdState.LoginStatus != KwsLoginStatus.LoggedIn) { throw new EAnpExInterrupted(); } // Post the command. AnpMsg cmd = Kws.NewKcdCmd(0); PrepareCmd(cmd); m_kcdQuery = Kws.PostKcdCmd(cmd, OnKcdQueryResult); } catch (Exception ex) { HandleFailure(ex); } }
/// <summary> /// Send the workspace creation command if we are ready to. /// </summary> private void SendCreateKwsCmdIfNeeded() { if (DoneFlag || m_step != OpStep.Connecting || Kws.Kcd.ConnStatus != KcdConnStatus.Connected) { return; } m_step = OpStep.CreateReply; AnpMsg cmd = Wm.NewKcdCmd(Kws.Kcd.MinorVersion, KAnp.KANP_CMD_MGT_CREATE_KWS); cmd.AddString(Creds.KwsName); cmd.AddBin(Creds.Ticket); cmd.AddUInt32(Convert.ToUInt32(Creds.PublicFlag)); cmd.AddUInt32(Convert.ToUInt32(Creds.SecureFlag)); if (cmd.Minor >= 4) { cmd.AddUInt32(Convert.ToUInt32(Creds.ThinKfsFlag)); } m_kcdQuery = Kws.PostKcdCmd(cmd, HandleCreateKwsCmdResult); }