コード例 #1
0
        private void LoadSettingRedmineMenu()
        {
            ClearMenu();

            UkagakaLabel lblGuide1 = new UkagakaLabel();

            lblGuide1.Text  = "修改你的Api Key:";
            lblGuide1.Width = 280;

            _mainMenu_txtApiKey          = new UkagakaTextBox();
            _mainMenu_txtApiKey.Text     = AppSettings.Settings.Instance.Redmine_ApiKey;
            _mainMenu_txtApiKey.Width    = AppSettings.Settings.Instance.Shell_SakuraDialogPanelWidth - 30;
            _mainMenu_confirmMenu        = new UkagakaMenu();
            _mainMenu_confirmMenu.Text   = "确定";
            _mainMenu_confirmMenu.Click += new EventHandler(_settings_redmine_confirmMenu_Click);

            dialogPanelSakura.Controls.Add(lblGuide1);
            dialogPanelSakura.Controls.Add(_mainMenu_txtApiKey);


            //_settings_chboxIsStartWhenWindowsStartup = new UkagakaCheckBox();
            //_settings_chboxIsStartWhenWindowsStartup.Text = "是否开机启动";
            //_settings_chboxIsStartWhenWindowsStartup.Checked = AppSettings.Settings.Instance.Redmine_IsStartWhenWindowsStartup;
            //_settings_chboxIsStartWhenWindowsStartup.Width = 150;
            //dialogPanelSakura.Controls.Add(_settings_chboxIsStartWhenWindowsStartup);

            _settings_chboxIsFloaterShown         = new UkagakaCheckBox();
            _settings_chboxIsFloaterShown.Text    = "是否显示浮动窗口";
            _settings_chboxIsFloaterShown.Checked = AppSettings.Settings.Instance.Redmine_IsFloaterShown;
            _settings_chboxIsFloaterShown.Width   = 150;
            dialogPanelSakura.Controls.Add(_settings_chboxIsFloaterShown);

            UkagakaLabel blank1 = new UkagakaLabel();

            blank1.Text = string.Empty;
            dialogPanelSakura.Controls.Add(blank1);
            dialogPanelSakura.Controls.Add(_mainMenu_confirmMenu);

            UkagakaLabel blank2 = new UkagakaLabel();

            blank2.Text = string.Empty;
            dialogPanelSakura.Controls.Add(blank2);

            AddReturnMenuItem();
        }
コード例 #2
0
        private void PopupApiKeyDialog()
        {
            popupPanel1.RowStyles.Clear();
            popupPanel1.ColumnCount = 1;
            popupPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            popupPanel1.RowCount = 2;
            popupPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
            popupPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            popupPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
            popupPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
            popupPanel1.Location  = new System.Drawing.Point(ClientSize.Width / 3, ClientSize.Height / 3);
            popupPanel1.Size      = new Size(300, 200);
            popupPanel1.Padding   = new Padding(10, 10, 10, 10);
            popupPanel1.BackColor = System.Drawing.ColorTranslator.FromHtml(Settings.Instance.Shell_DialogPanelBackColor);

            UkagakaLabel lblGuide1 = new UkagakaLabel();

            lblGuide1.Text   = "请输入你的Api Key:";
            lblGuide1.Width  = 280;
            lblGuide1.Height = 20;
            UkagakaLabel lblGuide2 = new UkagakaLabel();

            lblGuide2.Text               = "(你可以在 http://p.honestwalker.com/my/account 页面右侧的API access key中,点击Show,显示Api Key)";
            lblGuide2.AutoSize           = false;
            lblGuide2.Width              = 280;
            lblGuide2.Height             = 100;
            _mainMenu_txtApiKey          = new UkagakaTextBox();
            _mainMenu_txtApiKey.Text     = "(在此黏贴复制的Api Key)";
            _mainMenu_txtApiKey.Width    = 280;
            _mainMenu_txtApiKey.Click   += new EventHandler(txtApiKey_Click);
            _mainMenu_confirmMenu        = new UkagakaMenu();
            _mainMenu_confirmMenu.Text   = "确定";
            _mainMenu_confirmMenu.Click += new EventHandler(_mainMenu_confirmMenu_Click);

            popupPanel1.Controls.Add(lblGuide1, 0, 0);
            popupPanel1.Controls.Add(lblGuide2, 0, 1);
            popupPanel1.Controls.Add(_mainMenu_txtApiKey, 0, 2);
            popupPanel1.Controls.Add(_mainMenu_confirmMenu, 0, 3);
            popupPanel1.Show();
        }