示例#1
0
        //-------------------------------------------------------------------------------
        /// <summary>
        /// 新規タブを作成します。
        /// </summary>
        /// <param name="type">作成タブタイプ</param>
        /// <param name="data">タブデータ</param>
        /// <param name="listowner">[opt]リストのオーナー</param>
        public void MakeNewTab(TabSearchType type, string data, string listowner = null)
        {
            tssLabel.SetText(STR_WAITING_MAKETAB);
            LockAndProcess(_mreThreadTabConfirm, _mreThreadTabRun, (Action)(() =>
            {
                tssLabel.RemoveText(STR_WAITING_MAKETAB);
                TabData tabdata = new TabData() {
                    TabName = data,
                    SearchWord = data,
                    ListOwner = listowner
                };

                tabdata.SearchType = type;

                using (FrmMakeTab frm = new FrmMakeTab()) {
                    frm.TabData = tabdata;
                    if (frm.ShowDialog() == DialogResult.OK) {
                        tabdata = frm.TabData;
                    }
                    else { return; }
                }

                lock (SettingsData.TabDataDic) { SettingsData.TabDataDic.Add(tabdata.TabName, tabdata); }
                MakeTab(tabdata, true);

                SettingsData.Save(_settingsDataPath);
            }));
        }
示例#2
0
        //-------------------------------------------------------------------------------
        //
        private void tsmiTab_EditTab_Click(object sender, EventArgs e)
        {
            tssLabel.SetText(STR_WAITING_TABEDIT);
            TabPageEx tabpg = tabTwitDisp.SelectedTab;
            LockAndProcess(_mreThreadConfirm, _mreThreadRun, () =>
            {
                tssLabel.RemoveText(STR_WAITING_TABEDIT);
                TabData tabdata;
                lock (SettingsData.TabDataDic) { tabdata = SettingsData.TabDataDic[(string)tabpg.Tag]; }
                using (FrmMakeTab frm = new FrmMakeTab()) {
                    frm.TabData = tabdata;
                    if (frm.ShowDialog() == DialogResult.OK) {
                        lock (SettingsData.TabDataDic) {
                            SettingsData.TabDataDic.Remove((string)tabpg.Tag);
                            _dispTwitDic[tabpg].Tag = tabpg.Tag = tabpg.Text = frm.TabData.TabName;
                            SettingsData.TabDataDic.Add((string)tabpg.Tag, frm.TabData);
                        }
                        SettingsData.Save(_settingsDataPath);
                        tabpg.ToolTipText = TabDataToString(frm.TabData);

                        tssLabel.SetText(STR_WAITING_RENEWTABCONFIG);
                        LockAndProcess(_autoRenewDic, () =>
                        {
                            tssLabel.RemoveText(STR_WAITING_RENEWTABCONFIG);
                            _autoRenewDic[_dispTwitDic[tabpg]].Interval = new TimeSpan(0, 0, frm.TabData.GetInterval);
                            // 変化があった時
                            if (tabdata.SearchType != frm.TabData.SearchType || tabdata.SearchWord != frm.TabData.SearchWord) {
                                _autoRenewDic[_dispTwitDic[tabpg]].IsForce = true;
                                _dispTwitDic[tabpg].ClearAll();
                            }
                        });
                    }
                    else { return; }
                }
            });
        }