Esempio n. 1
0
        public void LoadMainMenu()
        {
            dialogPanelSakura.Controls.Clear();
            dialogPanelSakura.Show();

            UkagakaLabel lblWelcome = new UkagakaLabel();

            lblWelcome.Text  = "嗯?叫我?";
            lblWelcome.Width = 250;
            dialogPanelSakura.Controls.Add(lblWelcome);

            if (AppSettings.Settings.Instance.Service_IsRedmineEnabled)
            {
                MainMenu_AddRedmineMenuItems();
            }


            UkagakaMenu settingMenu = new UkagakaMenu();

            settingMenu.Text   = "设置";
            settingMenu.Click += new EventHandler(settingMenu_Click);
            UkagakaMenu exitMenu = new UkagakaMenu();

            exitMenu.Text   = "退出";
            exitMenu.Click += new EventHandler(ExitMenu_Click);

            dialogPanelSakura.Controls.Add(settingMenu);
            dialogPanelSakura.Controls.Add(exitMenu);
        }
Esempio n. 2
0
        public void SakuraSay(string text)
        {
            dialogPanelSakura.Controls.Clear();
            dialogPanelSakura.Show();

            UkagakaLabel lblSay = new UkagakaLabel();

            lblSay.Width = 250;
            lblSay.Text  = text;

            UkagakaMenu returnMenu = new UkagakaMenu();

            returnMenu.Text = "返回主菜单";

            dialogPanelSakura.Controls.Add(lblSay);
            dialogPanelSakura.Controls.Add(returnMenu);
        }
Esempio n. 3
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();
        }
Esempio n. 4
0
        public void LoadRedmineMainMenu()
        {
            ClearMenu();

            UkagakaMenu visitMyRedminePageMenu = new UkagakaMenu();

            visitMyRedminePageMenu.Text = "访问我的任务页";
            UkagakaLabel blank1 = new UkagakaLabel();

            blank1.Text = string.Empty;
            UkagakaMenu viewUrgentTaskMenu = new UkagakaMenu();

            viewUrgentTaskMenu.Text = "查看紧急的任务";
            UkagakaMenu viewRelativeUrgentTaskMenu = new UkagakaMenu();

            viewRelativeUrgentTaskMenu.Text = "查看较紧急的任务";
            UkagakaMenu viewOverDueTaskMenu = new UkagakaMenu();

            viewOverDueTaskMenu.Text = "查看已超期的任务";
            UkagakaMenu viewAllTaskMenu = new UkagakaMenu();

            viewAllTaskMenu.Text = "查看我所有的任务";

            visitMyRedminePageMenu.Click     += new EventHandler(visitMyRedminePageMenu_Click);
            viewUrgentTaskMenu.Click         += new EventHandler(viewUrgentTaskMenu_Click);
            viewRelativeUrgentTaskMenu.Click += new EventHandler(viewRelativeUrgentTaskMenu_Click);
            viewOverDueTaskMenu.Click        += new EventHandler(viewOverDueTaskMenu_Click);
            viewAllTaskMenu.Click            += new EventHandler(viewAllTaskMenu_Click);

            dialogPanelSakura.Controls.Add(visitMyRedminePageMenu);
            dialogPanelSakura.Controls.Add(blank1);
            dialogPanelSakura.Controls.Add(viewUrgentTaskMenu);
            dialogPanelSakura.Controls.Add(viewRelativeUrgentTaskMenu);
            dialogPanelSakura.Controls.Add(viewOverDueTaskMenu);
            dialogPanelSakura.Controls.Add(viewAllTaskMenu);

            UkagakaLabel blank2 = new UkagakaLabel();

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

            AddReturnMenuItem();
        }
Esempio n. 5
0
        private void MainMenu_AddRedmineMenuItems()
        {
            _lblOpenIssue             = new UkagakaLabel();
            _lblOpenIssue.Text        = "待完成的任务:-";
            _lblOpenIssue.Width       = 300;
            _lblOpenIssue.Cursor      = Cursors.Hand;
            _lblOpenIssue.Click      += new EventHandler(_lblOpenIssue_Click);
            _lblOpenIssue.MouseEnter += new EventHandler(_lblOpenIssue_MouseEnter);
            _lblOpenIssue.MouseLeave += new EventHandler(_lblOpenIssue_MouseLeave);

            _lblToCloseIssue             = new UkagakaLabel();
            _lblToCloseIssue.Text        = "待完成的任务:-";
            _lblToCloseIssue.Width       = 300;
            _lblToCloseIssue.Cursor      = Cursors.Hand;
            _lblToCloseIssue.Click      += new EventHandler(_lblToCloseIssue_Click);
            _lblToCloseIssue.MouseEnter += new EventHandler(_lblToCloseIssue_MouseEnter);
            _lblToCloseIssue.MouseLeave += new EventHandler(_lblToCloseIssue_MouseLeave);

            Settings.Instance.Redmine_ReadSettings();
            if (string.IsNullOrEmpty(Settings.Instance.Redmine_ApiKey))
            {
                PopupApiKeyDialog();
            }
            else
            {
                _issueUpdateWorker.DoWork += new DoWorkEventHandler(_issueUpdateWorker_DoWork);
                _issueUpdateWorker.RunWorkerAsync();
                StartScheduledUpdate();
            }

            UkagakaLabel blank1 = new UkagakaLabel();

            blank1.Text = string.Empty;
            UkagakaMenu redmineMenu = new UkagakaMenu();

            redmineMenu.Text   = "任务详情";
            redmineMenu.Click += new EventHandler(redmineMenu_Click);

            dialogPanelSakura.Controls.Add(_lblOpenIssue);
            dialogPanelSakura.Controls.Add(_lblToCloseIssue);
            dialogPanelSakura.Controls.Add(blank1);
            dialogPanelSakura.Controls.Add(redmineMenu);
        }
Esempio n. 6
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();
        }