Beispiel #1
0
    public void Initialize()
    {
        LoadSettings();


        ProductLabel.Text = $"{Vsix.Author} {Vsix.Name} {Persistence.Edition} {Vsix.Version}";

        if (Persistence.ServerState == 1)
        {
            StateLabel.Text       = "Enabled";
            EnableButton.Enabled  = false;
            DisableButton.Enabled = true;
            ServerIdText.Enabled  = false;
            MarkerText.Enabled    = false;
            ProfileText.Text      = ServerManager.GetProfileText();
            LogoPicture.Image     = IdeX.MainResource.idex_128;
        }
        else
        {
            StateLabel.Text       = "Disabled";
            EnableButton.Enabled  = true;
            DisableButton.Enabled = false;
            ServerIdText.Enabled  = true;
            MarkerText.Enabled    = true;
            ProfileText.Text      = "";
            LogoPicture.Image     = IdeX.MainResource.idex_gray_128;
        }
        UpdateLogfileButtons();
        UpdateServerIdPicture();
        UpdateMarkerPicture();

        AutoUpdateCheckbox.Checked = (Persistence.AutoUpdateLogfileControls == 1) ? true : false;
        Timer = XTimer.CreateStoppedTimer(Timer_IntervalElapsed);
        Timer.StartMultiEvent(1000, 5000);

        ServerManager.ServerDisabled += ServerManager_ServerDisabled;
        ServerManager.ServerEnabled  += ServerManager_ServerEnabled;

        ManualTT.SetToolTip(ServerIdLabel, XString.WrapWords(IdeX.MainResource.ServerIdLabelInfo));
        ManualTT.SetToolTip(MarkerLabel, XString.WrapWords(IdeX.MainResource.MarkerLabelInfo));
        ManualTT.SetToolTip(ProductCopyLink, XString.WrapWords(IdeX.MainResource.ProductCopyLinkInfo));
        ManualTT.SetToolTip(ProfileLabel, XString.WrapWords(IdeX.MainResource.ProfileLabelInfo));
        ManualTT.SetToolTip(ProfileCopyLink, XString.WrapWords(IdeX.MainResource.ProfileCopyLinkInfo));
        ManualTT.SetToolTip(LogfileCopyLink, XString.WrapWords(IdeX.MainResource.LogfileCopyLinkInfo));
        ManualTT.SetToolTip(LogCheckbox, XString.WrapWords(IdeX.MainResource.LogCheckboxInfo));
        ManualTT.SetToolTip(AutoUpdateCheckbox, XString.WrapWords(IdeX.MainResource.AutoUpdateCheckboxInfo));

        XLog.DeleteLogfileIfTooLarge();
    }
Beispiel #2
0
    private void AutoUpdateCheckbox_CheckedChanged(object sender, EventArgs e)
    {
        var autoUpdate = AutoUpdateCheckbox.Checked;

        Persistence.AutoUpdateLogfileControls = (autoUpdate == true) ? 1 : 0;

        if (Timer != null)
        {
            Timer.Discard();
            Timer = null;
        }

        if (autoUpdate)
        {
            Timer = XTimer.CreateStoppedTimer(Timer_IntervalElapsed);
            Timer.StartMultiEvent(1000, 5000);
        }
        else
        {
            OpenLogfileButton.Enabled  = true;
            ClearLogfileButton.Enabled = true;
        }
    }