コード例 #1
0
 private void EnableButton_Click(object sender, EventArgs e)
 {
     Ide.StatusBar_Set("Enable starts...");
     if (ServerManager.CanEnable())
     {
         Thread.Sleep(250);
         XLog.DeleteLogfile();
         Thread.Sleep(1250);
         ServerManager.EnableServer();
         Ide.StatusBar_Set("Enable succeeded");
     }
     else
     {
         Ide.StatusBar_Set("Enable failed, because the settings are invalid.");
     }
 }
コード例 #2
0
    private void ServerManager_ServerDisabled(object sender, EventArgs e)
    {
        var enableButton = GetOleCommand(EnableButtonCid) as OleMenuCommand;

        if (ServerManager.ServerState == 0)
        {
            if (ServerManager.CanEnable())
            {
                enableButton.Enabled = true;
            }
        }
        var disableButton = GetOleCommand(DisableButtonCid) as OleMenuCommand;

        if (ServerManager.ServerState == 0)
        {
            disableButton.Enabled = false;
        }
    }