Esempio n. 1
0
        private bool SelectTab(ref string tabName)
        {
            do
            {
                //振り分け先タブ選択
                if (TabDialog.ShowDialog() == DialogResult.Cancel)
                {
                    this.TopMost = SettingDialog.AlwaysTop;
                    return false;
                }
                this.TopMost = SettingDialog.AlwaysTop;
                tabName = TabDialog.SelectedTabName;

                ListTab.SelectedTab.Focus();
                //新規タブを選択→タブ作成
                if (tabName == Properties.Resources.IDRuleMenuItem_ClickText1)
                {
                    using (InputTabName inputName = new InputTabName())
                    {
                        inputName.TabName = _statuses.GetUniqueTabName();
                        inputName.ShowDialog();
                        if (inputName.DialogResult == DialogResult.Cancel) return false;
                        tabName = inputName.TabName;
                        inputName.Dispose();
                    }
                    this.TopMost = SettingDialog.AlwaysTop;
                    if (!string.IsNullOrEmpty(tabName))
                    {
                        if (!_statuses.AddTab(tabName, MyCommon.TabUsageType.UserDefined, null) || !AddNewTab(tabName, false, MyCommon.TabUsageType.UserDefined))
                        {
                            string tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText2, tabName);
                            MessageBox.Show(tmp, Properties.Resources.IDRuleMenuItem_ClickText3, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            //もう一度タブ名入力
                        }
                        else
                        {
                            return true;
                        }
                    }
                }
                else
                {
                    //既存タブを選択
                    return true;
                }
            }
            while (true);
        }
Esempio n. 2
0
 private void AddTabMenuItem_Click(object sender, EventArgs e)
 {
     string tabName = null;
     MyCommon.TabUsageType tabUsage;
     using (InputTabName inputName = new InputTabName())
     {
         inputName.TabName = _statuses.GetUniqueTabName();
         inputName.IsShowUsage = true;
         inputName.ShowDialog();
         if (inputName.DialogResult == DialogResult.Cancel) return;
         tabName = inputName.TabName;
         tabUsage = inputName.Usage;
         inputName.Dispose();
     }
     this.TopMost = SettingDialog.AlwaysTop;
     if (!string.IsNullOrEmpty(tabName))
     {
         //List対応
         ListElement list = null;
         if (tabUsage == MyCommon.TabUsageType.Lists)
         {
             using (ListAvailable listAvail = new ListAvailable())
             {
                 if (listAvail.ShowDialog(this) == DialogResult.Cancel) return;
                 if (listAvail.SelectedList == null) return;
                 list = listAvail.SelectedList;
             }
         }
         if (!_statuses.AddTab(tabName, tabUsage, list) || !AddNewTab(tabName, false, tabUsage, list))
         {
             string tmp = string.Format(Properties.Resources.AddTabMenuItem_ClickText1, tabName);
             MessageBox.Show(tmp, Properties.Resources.AddTabMenuItem_ClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             //成功
             SaveConfigsTabs();
             if (tabUsage == MyCommon.TabUsageType.PublicSearch)
             {
                 ListTab.SelectedIndex = ListTab.TabPages.Count - 1;
                 ListTabSelect(ListTab.TabPages[ListTab.TabPages.Count - 1]);
                 ListTab.SelectedTab.Controls["panelSearch"].Controls["comboSearch"].Focus();
             }
             if (tabUsage == MyCommon.TabUsageType.Lists)
             {
                 ListTab.SelectedIndex = ListTab.TabPages.Count - 1;
                 ListTabSelect(ListTab.TabPages[ListTab.TabPages.Count - 1]);
                 GetTimeline(MyCommon.WORKERTYPE.List, 1, 0, tabName);
             }
         }
     }
 }
Esempio n. 3
0
        public bool TabRename(ref string tabName)
        {
            //タブ名変更
            string newTabText = null;
            using (InputTabName inputName = new InputTabName())
            {
                inputName.TabName = tabName;
                inputName.ShowDialog();
                if (inputName.DialogResult == DialogResult.Cancel) return false;
                newTabText = inputName.TabName;
                inputName.Dispose();
            }
            this.TopMost = SettingDialog.AlwaysTop;
            if (!string.IsNullOrEmpty(newTabText))
            {
                //新タブ名存在チェック
                for (int i = 0; i < ListTab.TabCount; i++)
                {
                    if (ListTab.TabPages[i].Text == newTabText)
                    {
                        string tmp = string.Format(Properties.Resources.Tabs_DoubleClickText1, newTabText);
                        MessageBox.Show(tmp, Properties.Resources.Tabs_DoubleClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return false;
                    }
                }
                //タブ名のリスト作り直し(デフォルトタブ以外は再作成)
                for (int i = 0; i < ListTab.TabCount; i++)
                {
                    if (_statuses.IsDistributableTab(ListTab.TabPages[i].Text))
                    {
                        TabDialog.RemoveTab(ListTab.TabPages[i].Text);
                    }
                    if (ListTab.TabPages[i].Text == tabName)
                    {
                        ListTab.TabPages[i].Text = newTabText;
                    }
                }
                _statuses.RenameTab(tabName, newTabText);

                for (int i = 0; i < ListTab.TabCount; i++)
                {
                    if (_statuses.IsDistributableTab(ListTab.TabPages[i].Text))
                    {
                        if (ListTab.TabPages[i].Text == tabName)
                        {
                            ListTab.TabPages[i].Text = newTabText;
                        }
                        TabDialog.AddTab(ListTab.TabPages[i].Text);
                    }
                }
                SaveConfigsCommon();
                SaveConfigsTabs();
                _rclickTabName = newTabText;
                tabName = newTabText;
                return true;
            }
            else
            {
                return false;
            }
        }