Пример #1
0
        public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            settingLocal.StatusText = this.StatusText.Text;

            switch (this.ComboBoxPostKeySelect.SelectedIndex)
            {
                case 2:
                    settingCommon.PostShiftEnter = true;
                    settingCommon.PostCtrlEnter = false;
                    break;
                case 1:
                    settingCommon.PostCtrlEnter = true;
                    settingCommon.PostShiftEnter = false;
                    break;
                case 0:
                    settingCommon.PostCtrlEnter = false;
                    settingCommon.PostShiftEnter = false;
                    break;
            }

            settingLocal.UseRecommendStatus = this.CheckUseRecommendStatus.Checked;
            settingCommon.RetweetNoConfirm = this.CheckRetweetNoConfirm.Checked;
            settingCommon.UseAtIdSupplement = this.CheckAtIdSupple.Checked;
            settingCommon.UseHashSupplement = this.CheckHashSupple.Checked;
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 public PageViewModel()
 {
     LocalSettings   = DataRWLocalFileRepository.ReadObjFromFile <SettingLocal>(AppSet.LocalSettingFileName);
     RedColorBrush   = new SolidColorBrush();
     GreenColorBrush = new SolidColorBrush();
     BlueColorBrush  = new SolidColorBrush();
 }
Пример #3
0
        public void LoadConfig(SettingLocal settingLocal)
        {
            switch (settingLocal.ProxyType)
            {
                case ProxyType.None:
                    this.RadioProxyNone.Checked = true;
                    break;
                case ProxyType.IE:
                    this.RadioProxyIE.Checked = true;
                    break;
                default:
                    this.RadioProxySpecified.Checked = true;
                    break;
            }

            var chk = this.RadioProxySpecified.Checked;
            this.LabelProxyAddress.Enabled = chk;
            this.TextProxyAddress.Enabled = chk;
            this.LabelProxyPort.Enabled = chk;
            this.TextProxyPort.Enabled = chk;
            this.LabelProxyUser.Enabled = chk;
            this.TextProxyUser.Enabled = chk;
            this.LabelProxyPassword.Enabled = chk;
            this.TextProxyPassword.Enabled = chk;

            this.TextProxyAddress.Text = settingLocal.ProxyAddress;
            this.TextProxyPort.Text = settingLocal.ProxyPort.ToString();
            this.TextProxyUser.Text = settingLocal.ProxyUser;
            this.TextProxyPassword.Text = settingLocal.ProxyPassword;
        }
Пример #4
0
        public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            this.UReadMng.Checked = settingCommon.UnreadManage;
            this.PlaySnd.Checked = settingCommon.PlaySound;
            this.BrowserPathText.Text = settingLocal.BrowserPath;
            this.CheckCloseToExit.Checked = settingCommon.CloseToExit;
            this.CheckMinimizeToTray.Checked = settingCommon.MinimizeToTray;
            this.CheckFavRestrict.Checked = settingCommon.RestrictFavCheck;
            this.chkReadOwnPost.Checked = settingCommon.ReadOwnPost;
            this.CheckReadOldPosts.Checked = settingCommon.ReadOldPosts;

            this.HotkeyCheck.Checked = settingCommon.HotkeyEnabled;
            this.HotkeyAlt.Checked = ((settingCommon.HotkeyModifier & Keys.Alt) == Keys.Alt);
            this.HotkeyCtrl.Checked = ((settingCommon.HotkeyModifier & Keys.Control) == Keys.Control);
            this.HotkeyShift.Checked = ((settingCommon.HotkeyModifier & Keys.Shift) == Keys.Shift);
            this.HotkeyWin.Checked = ((settingCommon.HotkeyModifier & Keys.LWin) == Keys.LWin);
            this.HotkeyCode.Text = settingCommon.HotkeyValue.ToString();
            this.HotkeyText.Text = settingCommon.HotkeyKey.ToString();
            this.HotkeyText.Tag = settingCommon.HotkeyKey;
            this.HotkeyAlt.Enabled = settingCommon.HotkeyEnabled;
            this.HotkeyShift.Enabled = settingCommon.HotkeyEnabled;
            this.HotkeyCtrl.Enabled = settingCommon.HotkeyEnabled;
            this.HotkeyWin.Enabled = settingCommon.HotkeyEnabled;
            this.HotkeyText.Enabled = settingCommon.HotkeyEnabled;
            this.HotkeyCode.Enabled = settingCommon.HotkeyEnabled;

            this.CheckOpenUserTimeline.Checked = settingCommon.OpenUserTimeline;
            this.ListDoubleClickActionComboBox.SelectedIndex = settingCommon.ListDoubleClickAction;
            this.TabMouseLockCheck.Checked = settingCommon.TabMouseLock;
        }
Пример #5
0
        public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            settingCommon.PlaySound = this.PlaySnd.Checked;
            settingCommon.UnreadManage = this.UReadMng.Checked;
            settingLocal.BrowserPath = this.BrowserPathText.Text.Trim();
            settingCommon.CloseToExit = this.CheckCloseToExit.Checked;
            settingCommon.MinimizeToTray = this.CheckMinimizeToTray.Checked;
            settingCommon.RestrictFavCheck = this.CheckFavRestrict.Checked;
            settingCommon.ReadOwnPost = this.chkReadOwnPost.Checked;
            settingCommon.ReadOldPosts = this.CheckReadOldPosts.Checked;

            settingCommon.HotkeyEnabled = this.HotkeyCheck.Checked;
            settingCommon.HotkeyModifier = Keys.None;
            if (this.HotkeyAlt.Checked)
                settingCommon.HotkeyModifier |= Keys.Alt;
            if (this.HotkeyShift.Checked)
                settingCommon.HotkeyModifier |= Keys.Shift;
            if (this.HotkeyCtrl.Checked)
                settingCommon.HotkeyModifier |= Keys.Control;
            if (this.HotkeyWin.Checked)
                settingCommon.HotkeyModifier |= Keys.LWin;
            int.TryParse(this.HotkeyCode.Text, out settingCommon.HotkeyValue);
            settingCommon.HotkeyKey = (Keys)this.HotkeyText.Tag;

            settingCommon.OpenUserTimeline = this.CheckOpenUserTimeline.Checked;
            settingCommon.ListDoubleClickAction = this.ListDoubleClickActionComboBox.SelectedIndex;
            settingCommon.TabMouseLock = this.TabMouseLockCheck.Checked;
        }
Пример #6
0
        public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            this.UReadMng.Checked            = settingCommon.UnreadManage;
            this.PlaySnd.Checked             = settingCommon.PlaySound;
            this.BrowserPathText.Text        = settingLocal.BrowserPath;
            this.CheckCloseToExit.Checked    = settingCommon.CloseToExit;
            this.CheckMinimizeToTray.Checked = settingCommon.MinimizeToTray;
            this.CheckFavRestrict.Checked    = settingCommon.RestrictFavCheck;
            this.chkReadOwnPost.Checked      = settingCommon.ReadOwnPost;
            this.CheckReadOldPosts.Checked   = settingCommon.ReadOldPosts;

            this.HotkeyCheck.Checked = settingCommon.HotkeyEnabled;
            this.HotkeyAlt.Checked   = ((settingCommon.HotkeyModifier & Keys.Alt) == Keys.Alt);
            this.HotkeyCtrl.Checked  = ((settingCommon.HotkeyModifier & Keys.Control) == Keys.Control);
            this.HotkeyShift.Checked = ((settingCommon.HotkeyModifier & Keys.Shift) == Keys.Shift);
            this.HotkeyWin.Checked   = ((settingCommon.HotkeyModifier & Keys.LWin) == Keys.LWin);
            this.HotkeyCode.Text     = settingCommon.HotkeyValue.ToString();
            this.HotkeyText.Text     = settingCommon.HotkeyKey.ToString();
            this.HotkeyText.Tag      = settingCommon.HotkeyKey;
            this.HotkeyAlt.Enabled   = settingCommon.HotkeyEnabled;
            this.HotkeyShift.Enabled = settingCommon.HotkeyEnabled;
            this.HotkeyCtrl.Enabled  = settingCommon.HotkeyEnabled;
            this.HotkeyWin.Enabled   = settingCommon.HotkeyEnabled;
            this.HotkeyText.Enabled  = settingCommon.HotkeyEnabled;
            this.HotkeyCode.Enabled  = settingCommon.HotkeyEnabled;

            this.CheckOpenUserTimeline.Checked = settingCommon.OpenUserTimeline;
            this.ListDoubleClickActionComboBox.SelectedIndex = settingCommon.ListDoubleClickAction;
            this.TabMouseLockCheck.Checked = settingCommon.TabMouseLock;
        }
Пример #7
0
        public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            this.BasedPanel.LoadConfig(settingCommon);
            this.GetPeriodPanel.LoadConfig(settingCommon);
            this.StartupPanel.LoadConfig(settingCommon);
            this.TweetPrvPanel.LoadConfig(settingCommon);
            this.TweetActPanel.LoadConfig(settingCommon, settingLocal);
            this.ActionPanel.LoadConfig(settingCommon, settingLocal);
            this.FontPanel.LoadConfig(settingLocal);
            this.FontPanel2.LoadConfig(settingLocal);
            this.PreviewPanel.LoadConfig(settingCommon);
            this.GetCountPanel.LoadConfig(settingCommon);
            this.ShortUrlPanel.LoadConfig(settingCommon);
            this.ProxyPanel.LoadConfig(settingLocal);
            this.CooperatePanel.LoadConfig(settingCommon);
            this.ConnectionPanel.LoadConfig(settingCommon);
            this.NotifyPanel.LoadConfig(settingCommon);

            var activeUser = settingCommon.UserAccounts.FirstOrDefault(x => x.UserId == this.tw.UserId);
            if (activeUser != null)
            {
                this.BasedPanel.AuthUserCombo.SelectedItem = activeUser;
                this.InitialUserId = activeUser.UserId;
            }
        }
Пример #8
0
        public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            settingLocal.StatusText = this.StatusText.Text;

            switch (this.ComboBoxPostKeySelect.SelectedIndex)
            {
            case 2:
                settingCommon.PostShiftEnter = true;
                settingCommon.PostCtrlEnter  = false;
                break;

            case 1:
                settingCommon.PostCtrlEnter  = true;
                settingCommon.PostShiftEnter = false;
                break;

            case 0:
                settingCommon.PostCtrlEnter  = false;
                settingCommon.PostShiftEnter = false;
                break;
            }

            settingLocal.UseRecommendStatus  = this.CheckUseRecommendStatus.Checked;
            settingCommon.RetweetNoConfirm   = this.CheckRetweetNoConfirm.Checked;
            settingCommon.UseAtIdSupplement  = this.CheckAtIdSupple.Checked;
            settingCommon.UseHashSupplement  = this.CheckHashSupple.Checked;
            settingCommon.AlphaPNGWorkaround = this.CheckAlphaPNGWorkaround.Checked;
        }
Пример #9
0
        public void LoadConfig(SettingLocal settingLocal)
        {
            switch (settingLocal.ProxyType)
            {
            case ProxyType.None:
                this.RadioProxyNone.Checked = true;
                break;

            case ProxyType.IE:
                this.RadioProxyIE.Checked = true;
                break;

            default:
                this.RadioProxySpecified.Checked = true;
                break;
            }

            var chk = this.RadioProxySpecified.Checked;

            this.LabelProxyAddress.Enabled  = chk;
            this.TextProxyAddress.Enabled   = chk;
            this.LabelProxyPort.Enabled     = chk;
            this.TextProxyPort.Enabled      = chk;
            this.LabelProxyUser.Enabled     = chk;
            this.TextProxyUser.Enabled      = chk;
            this.LabelProxyPassword.Enabled = chk;
            this.TextProxyPassword.Enabled  = chk;

            this.TextProxyAddress.Text  = settingLocal.ProxyAddress;
            this.TextProxyPort.Text     = settingLocal.ProxyPort.ToString();
            this.TextProxyUser.Text     = settingLocal.ProxyUser;
            this.TextProxyPassword.Text = settingLocal.ProxyPassword;
        }
Пример #10
0
 public void SaveConfig(SettingLocal settingLocal)
 {
     settingLocal.ColorSelf           = this.lblSelf.BackColor;
     settingLocal.ColorAtSelf         = this.lblAtSelf.BackColor;
     settingLocal.ColorTarget         = this.lblTarget.BackColor;
     settingLocal.ColorAtTarget       = this.lblAtTarget.BackColor;
     settingLocal.ColorAtFromTarget   = this.lblAtFromTarget.BackColor;
     settingLocal.ColorAtTo           = this.lblAtTo.BackColor;
     settingLocal.ColorInputBackcolor = this.lblInputBackcolor.BackColor;
     settingLocal.ColorInputFont      = this.lblInputFont.ForeColor;
     settingLocal.ColorListBackcolor  = this.lblListBackcolor.BackColor;
     settingLocal.FontInputFont       = this.lblInputFont.Font;
 }
Пример #11
0
 public void LoadConfig(SettingLocal settingLocal)
 {
     this.lblSelf.BackColor           = settingLocal.ColorSelf;
     this.lblAtSelf.BackColor         = settingLocal.ColorAtSelf;
     this.lblTarget.BackColor         = settingLocal.ColorTarget;
     this.lblAtTarget.BackColor       = settingLocal.ColorAtTarget;
     this.lblAtFromTarget.BackColor   = settingLocal.ColorAtFromTarget;
     this.lblAtTo.BackColor           = settingLocal.ColorAtTo;
     this.lblInputBackcolor.BackColor = settingLocal.ColorInputBackcolor;
     this.lblInputFont.ForeColor      = settingLocal.ColorInputFont;
     this.lblInputFont.Font           = settingLocal.FontInputFont;
     this.lblListBackcolor.BackColor  = settingLocal.ColorListBackcolor;
 }
Пример #12
0
 public void SaveConfig(SettingLocal settingLocal)
 {
     settingLocal.ColorSelf = this.lblSelf.BackColor;
     settingLocal.ColorAtSelf = this.lblAtSelf.BackColor;
     settingLocal.ColorTarget = this.lblTarget.BackColor;
     settingLocal.ColorAtTarget = this.lblAtTarget.BackColor;
     settingLocal.ColorAtFromTarget = this.lblAtFromTarget.BackColor;
     settingLocal.ColorAtTo = this.lblAtTo.BackColor;
     settingLocal.ColorInputBackcolor = this.lblInputBackcolor.BackColor;
     settingLocal.ColorInputFont = this.lblInputFont.ForeColor;
     settingLocal.ColorListBackcolor = this.lblListBackcolor.BackColor;
     settingLocal.FontInputFont = this.lblInputFont.Font;
 }
Пример #13
0
 public void LoadConfig(SettingLocal settingLocal)
 {
     this.lblSelf.BackColor = settingLocal.ColorSelf;
     this.lblAtSelf.BackColor = settingLocal.ColorAtSelf;
     this.lblTarget.BackColor = settingLocal.ColorTarget;
     this.lblAtTarget.BackColor = settingLocal.ColorAtTarget;
     this.lblAtFromTarget.BackColor = settingLocal.ColorAtFromTarget;
     this.lblAtTo.BackColor = settingLocal.ColorAtTo;
     this.lblInputBackcolor.BackColor = settingLocal.ColorInputBackcolor;
     this.lblInputFont.ForeColor = settingLocal.ColorInputFont;
     this.lblInputFont.Font = settingLocal.FontInputFont;
     this.lblListBackcolor.BackColor = settingLocal.ColorListBackcolor;
 }
Пример #14
0
 public void LoadConfig(SettingLocal settingLocal)
 {
     this.lblListFont.Font = settingLocal.FontRead;
     this.lblUnread.Font = settingLocal.FontUnread;
     this.lblUnread.ForeColor = settingLocal.ColorUnread;
     this.lblListFont.ForeColor = settingLocal.ColorRead;
     this.lblFav.ForeColor = settingLocal.ColorFav;
     this.lblOWL.ForeColor = settingLocal.ColorOWL;
     this.lblRetweet.ForeColor = settingLocal.ColorRetweet;
     this.lblDetail.Font = settingLocal.FontDetail;
     this.lblDetailBackcolor.BackColor = settingLocal.ColorDetailBackcolor;
     this.lblDetail.ForeColor = settingLocal.ColorDetail;
     this.lblDetailLink.ForeColor = settingLocal.ColorDetailLink;
 }
Пример #15
0
 public void SaveConfig(SettingLocal settingLocal)
 {
     settingLocal.FontUnread           = this.lblUnread.Font;   // 未使用
     settingLocal.ColorUnread          = this.lblUnread.ForeColor;
     settingLocal.FontRead             = this.lblListFont.Font; // リストフォントとして使用
     settingLocal.ColorRead            = this.lblListFont.ForeColor;
     settingLocal.ColorFav             = this.lblFav.ForeColor;
     settingLocal.ColorOWL             = this.lblOWL.ForeColor;
     settingLocal.ColorRetweet         = this.lblRetweet.ForeColor;
     settingLocal.FontDetail           = this.lblDetail.Font;
     settingLocal.ColorDetailBackcolor = this.lblDetailBackcolor.BackColor;
     settingLocal.ColorDetail          = this.lblDetail.ForeColor;
     settingLocal.ColorDetailLink      = this.lblDetailLink.ForeColor;
 }
Пример #16
0
 public void LoadConfig(SettingLocal settingLocal)
 {
     this.lblListFont.Font             = settingLocal.FontRead;
     this.lblUnread.Font               = settingLocal.FontUnread;
     this.lblUnread.ForeColor          = settingLocal.ColorUnread;
     this.lblListFont.ForeColor        = settingLocal.ColorRead;
     this.lblFav.ForeColor             = settingLocal.ColorFav;
     this.lblOWL.ForeColor             = settingLocal.ColorOWL;
     this.lblRetweet.ForeColor         = settingLocal.ColorRetweet;
     this.lblDetail.Font               = settingLocal.FontDetail;
     this.lblDetailBackcolor.BackColor = settingLocal.ColorDetailBackcolor;
     this.lblDetail.ForeColor          = settingLocal.ColorDetail;
     this.lblDetailLink.ForeColor      = settingLocal.ColorDetailLink;
 }
Пример #17
0
 public void SaveConfig(SettingLocal settingLocal)
 {
     settingLocal.FontUnread = this.lblUnread.Font; // 未使用
     settingLocal.ColorUnread = this.lblUnread.ForeColor;
     settingLocal.FontRead = this.lblListFont.Font; // リストフォントとして使用
     settingLocal.ColorRead = this.lblListFont.ForeColor;
     settingLocal.ColorFav = this.lblFav.ForeColor;
     settingLocal.ColorOWL = this.lblOWL.ForeColor;
     settingLocal.ColorRetweet = this.lblRetweet.ForeColor;
     settingLocal.FontDetail = this.lblDetail.Font;
     settingLocal.ColorDetailBackcolor = this.lblDetailBackcolor.BackColor;
     settingLocal.ColorDetail = this.lblDetail.ForeColor;
     settingLocal.ColorDetailLink = this.lblDetailLink.ForeColor;
 }
Пример #18
0
        public void SaveConfig(SettingLocal settingLocal)
        {
            if (this.RadioProxyNone.Checked)
            {
                settingLocal.ProxyType = ProxyType.None;
            }
            else if (this.RadioProxyIE.Checked)
            {
                settingLocal.ProxyType = ProxyType.IE;
            }
            else
            {
                settingLocal.ProxyType = ProxyType.Specified;
            }

            settingLocal.ProxyAddress = this.TextProxyAddress.Text.Trim();
            settingLocal.ProxyPort = int.Parse(this.TextProxyPort.Text.Trim());
            settingLocal.ProxyUser = this.TextProxyUser.Text.Trim();
            settingLocal.ProxyPassword = this.TextProxyPassword.Text.Trim();
        }
Пример #19
0
        public void SaveConfig(SettingLocal settingLocal)
        {
            if (this.RadioProxyNone.Checked)
            {
                settingLocal.ProxyType = ProxyType.None;
            }
            else if (this.RadioProxyIE.Checked)
            {
                settingLocal.ProxyType = ProxyType.IE;
            }
            else
            {
                settingLocal.ProxyType = ProxyType.Specified;
            }

            settingLocal.ProxyAddress  = this.TextProxyAddress.Text.Trim();
            settingLocal.ProxyPort     = int.Parse(this.TextProxyPort.Text.Trim());
            settingLocal.ProxyUser     = this.TextProxyUser.Text.Trim();
            settingLocal.ProxyPassword = this.TextProxyPassword.Text.Trim();
        }
Пример #20
0
        public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            this.StatusText.Text = settingLocal.StatusText;

            if (settingCommon.PostCtrlEnter)
            {
                this.ComboBoxPostKeySelect.SelectedIndex = 1;
            }
            else if (settingCommon.PostShiftEnter)
            {
                this.ComboBoxPostKeySelect.SelectedIndex = 2;
            }
            else
            {
                this.ComboBoxPostKeySelect.SelectedIndex = 0;
            }

            this.CheckUseRecommendStatus.Checked = settingLocal.UseRecommendStatus;
            this.CheckRetweetNoConfirm.Checked = settingCommon.RetweetNoConfirm;
            this.CheckAtIdSupple.Checked = settingCommon.UseAtIdSupplement;
            this.CheckHashSupple.Checked = settingCommon.UseHashSupplement;
        }
Пример #21
0
        public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            this.StatusText.Text = settingLocal.StatusText;

            if (settingCommon.PostCtrlEnter)
            {
                this.ComboBoxPostKeySelect.SelectedIndex = 1;
            }
            else if (settingCommon.PostShiftEnter)
            {
                this.ComboBoxPostKeySelect.SelectedIndex = 2;
            }
            else
            {
                this.ComboBoxPostKeySelect.SelectedIndex = 0;
            }

            this.CheckUseRecommendStatus.Checked = settingLocal.UseRecommendStatus;
            this.CheckRetweetNoConfirm.Checked   = settingCommon.RetweetNoConfirm;
            this.CheckAtIdSupple.Checked         = settingCommon.UseAtIdSupplement;
            this.CheckHashSupple.Checked         = settingCommon.UseHashSupplement;
        }
Пример #22
0
        public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            settingCommon.PlaySound        = this.PlaySnd.Checked;
            settingCommon.UnreadManage     = this.UReadMng.Checked;
            settingLocal.BrowserPath       = this.BrowserPathText.Text.Trim();
            settingCommon.CloseToExit      = this.CheckCloseToExit.Checked;
            settingCommon.MinimizeToTray   = this.CheckMinimizeToTray.Checked;
            settingCommon.RestrictFavCheck = this.CheckFavRestrict.Checked;
            settingCommon.ReadOwnPost      = this.chkReadOwnPost.Checked;
            settingCommon.ReadOldPosts     = this.CheckReadOldPosts.Checked;

            settingCommon.HotkeyEnabled  = this.HotkeyCheck.Checked;
            settingCommon.HotkeyModifier = Keys.None;
            if (this.HotkeyAlt.Checked)
            {
                settingCommon.HotkeyModifier |= Keys.Alt;
            }
            if (this.HotkeyShift.Checked)
            {
                settingCommon.HotkeyModifier |= Keys.Shift;
            }
            if (this.HotkeyCtrl.Checked)
            {
                settingCommon.HotkeyModifier |= Keys.Control;
            }
            if (this.HotkeyWin.Checked)
            {
                settingCommon.HotkeyModifier |= Keys.LWin;
            }
            int.TryParse(this.HotkeyCode.Text, out settingCommon.HotkeyValue);
            settingCommon.HotkeyKey = (Keys)this.HotkeyText.Tag;

            settingCommon.OpenUserTimeline      = this.CheckOpenUserTimeline.Checked;
            settingCommon.ListDoubleClickAction = this.ListDoubleClickActionComboBox.SelectedIndex;
            settingCommon.TabMouseLock          = this.TabMouseLockCheck.Checked;
        }
Пример #23
0
        private void LoadConfig()
        {
            _cfgCommon = SettingCommon.Load();
            if (_cfgCommon.UserAccounts == null || _cfgCommon.UserAccounts.Count == 0)
            {
                _cfgCommon.UserAccounts = new List<UserAccount>();
                if (!string.IsNullOrEmpty(_cfgCommon.UserName))
                {
                    UserAccount account = new UserAccount();
                    account.Username = _cfgCommon.UserName;
                    account.UserId = _cfgCommon.UserId;
                    account.Token = _cfgCommon.Token;
                    account.TokenSecret = _cfgCommon.TokenSecret;

                    _cfgCommon.UserAccounts.Add(account);
                }
            }
            _cfgLocal = SettingLocal.Load();
            List<TabClass> tabs = SettingTabs.Load().Tabs;
            foreach (TabClass tb in tabs)
            {
                try
                {
                    _statuses.Tabs.Add(tb.TabName, tb);
                }
                catch (Exception)
                {
                    tb.TabName = _statuses.GetUniqueTabName();
                    _statuses.Tabs.Add(tb.TabName, tb);
                }
            }
            if (_statuses.Tabs.Count == 0)
            {
                _statuses.AddTab(MyCommon.DEFAULTTAB.RECENT, MyCommon.TabUsageType.Home, null);
                _statuses.AddTab(MyCommon.DEFAULTTAB.REPLY, MyCommon.TabUsageType.Mentions, null);
                _statuses.AddTab(MyCommon.DEFAULTTAB.DM, MyCommon.TabUsageType.DirectMessage, null);
                _statuses.AddTab(MyCommon.DEFAULTTAB.FAV, MyCommon.TabUsageType.Favorites, null);
            }
        }
Пример #24
0
        public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
        {
            this.BasedPanel.SaveConfig(settingCommon);
            this.GetPeriodPanel.SaveConfig(settingCommon);
            this.StartupPanel.SaveConfig(settingCommon);
            this.TweetPrvPanel.SaveConfig(settingCommon);
            this.TweetActPanel.SaveConfig(settingCommon, settingLocal);
            this.ActionPanel.SaveConfig(settingCommon, settingLocal);
            this.FontPanel.SaveConfig(settingLocal);
            this.FontPanel2.SaveConfig(settingLocal);
            this.PreviewPanel.SaveConfig(settingCommon);
            this.GetCountPanel.SaveConfig(settingCommon);
            this.ShortUrlPanel.SaveConfig(settingCommon);
            this.ProxyPanel.SaveConfig(settingLocal);
            this.CooperatePanel.SaveConfig(settingCommon);
            this.ConnectionPanel.SaveConfig(settingCommon);
            this.NotifyPanel.SaveConfig(settingCommon);

            var userAccountIdx = this.BasedPanel.AuthUserCombo.SelectedIndex;
            if (userAccountIdx != -1)
            {
                var u = settingCommon.UserAccounts[userAccountIdx];
                this.tw.Initialize(u.Token, u.TokenSecret, u.Username, u.UserId);
            }
            else
            {
                this.tw.ClearAuthInfo();
                this.tw.Initialize("", "", "", 0);
            }
        }
Пример #25
0
        private void LoadConfig()
        {
            _cfgCommon = SettingCommon.Load();
            SettingCommon.Instance = this._cfgCommon;
            if (_cfgCommon.UserAccounts == null || _cfgCommon.UserAccounts.Count == 0)
            {
                _cfgCommon.UserAccounts = new List<UserAccount>();
                if (!string.IsNullOrEmpty(_cfgCommon.UserName))
                {
                    UserAccount account = new UserAccount();
                    account.Username = _cfgCommon.UserName;
                    account.UserId = _cfgCommon.UserId;
                    account.Token = _cfgCommon.Token;
                    account.TokenSecret = _cfgCommon.TokenSecret;

                    _cfgCommon.UserAccounts.Add(account);
                }
            }

            _cfgLocal = SettingLocal.Load();

            // v1.2.4 以前の設定には ScaleDimension の項目がないため、現在の DPI と同じとして扱う
            if (_cfgLocal.ScaleDimension.IsEmpty)
                _cfgLocal.ScaleDimension = this.CurrentAutoScaleDimensions;

            var tabsSetting = SettingTabs.Load().Tabs;
            foreach (var tabSetting in tabsSetting)
            {
                TabModel tab;
                switch (tabSetting.TabType)
                {
                    case MyCommon.TabUsageType.Home:
                        tab = new HomeTabModel(tabSetting.TabName);
                        break;
                    case MyCommon.TabUsageType.Mentions:
                        tab = new MentionsTabModel(tabSetting.TabName);
                        break;
                    case MyCommon.TabUsageType.DirectMessage:
                        tab = new DirectMessagesTabModel(tabSetting.TabName);
                        break;
                    case MyCommon.TabUsageType.Favorites:
                        tab = new FavoritesTabModel(tabSetting.TabName);
                        break;
                    case MyCommon.TabUsageType.UserDefined:
                        tab = new FilterTabModel(tabSetting.TabName);
                        break;
                    case MyCommon.TabUsageType.UserTimeline:
                        tab = new UserTimelineTabModel(tabSetting.TabName, tabSetting.User);
                        break;
                    case MyCommon.TabUsageType.PublicSearch:
                        tab = new PublicSearchTabModel(tabSetting.TabName)
                        {
                            SearchWords = tabSetting.SearchWords,
                            SearchLang = tabSetting.SearchLang,
                        };
                        break;
                    case MyCommon.TabUsageType.Lists:
                        tab = new ListTimelineTabModel(tabSetting.TabName, tabSetting.ListInfo);
                        break;
                    case MyCommon.TabUsageType.Mute:
                        tab = new MuteTabModel(tabSetting.TabName);
                        break;
                    default:
                        continue;
                }

                tab.UnreadManage = tabSetting.UnreadManage;
                tab.Protected = tabSetting.Protected;
                tab.Notify = tabSetting.Notify;
                tab.SoundFile = tabSetting.SoundFile;

                if (tab.IsDistributableTabType)
                {
                    var filterTab = (FilterTabModel)tab;
                    filterTab.FilterArray = tabSetting.FilterArray;
                    filterTab.FilterModified = false;
                }

                if (this._statuses.ContainsTab(tab.TabName))
                    tab.TabName = this._statuses.MakeTabName("MyTab");

                this._statuses.AddTab(tab);
            }
            if (_statuses.Tabs.Count == 0)
            {
                _statuses.AddTab(new HomeTabModel());
                _statuses.AddTab(new MentionsTabModel());
                _statuses.AddTab(new DirectMessagesTabModel());
                _statuses.AddTab(new FavoritesTabModel());
            }
        }
Пример #26
0
        private void LoadConfig()
        {
            _cfgCommon = SettingCommon.Load();
            SettingCommon.Instance = this._cfgCommon;
            if (_cfgCommon.UserAccounts == null || _cfgCommon.UserAccounts.Count == 0)
            {
                _cfgCommon.UserAccounts = new List<UserAccount>();
                if (!string.IsNullOrEmpty(_cfgCommon.UserName))
                {
                    UserAccount account = new UserAccount();
                    account.Username = _cfgCommon.UserName;
                    account.UserId = _cfgCommon.UserId;
                    account.Token = _cfgCommon.Token;
                    account.TokenSecret = _cfgCommon.TokenSecret;

                    _cfgCommon.UserAccounts.Add(account);
                }
            }

            _cfgLocal = SettingLocal.Load();

            // v1.2.4 以前の設定には ScaleDimension の項目がないため、現在の DPI と同じとして扱う
            if (_cfgLocal.ScaleDimension.IsEmpty)
                _cfgLocal.ScaleDimension = this.CurrentAutoScaleDimensions;

            List<TabClass> tabs = SettingTabs.Load().Tabs;
            foreach (TabClass tb in tabs)
            {
                try
                {
                    tb.FilterModified = false;
                    _statuses.Tabs.Add(tb.TabName, tb);
                }
                catch (Exception)
                {
                    tb.TabName = _statuses.GetUniqueTabName();
                    _statuses.Tabs.Add(tb.TabName, tb);
                }
            }
            if (_statuses.Tabs.Count == 0)
            {
                _statuses.AddTab(MyCommon.DEFAULTTAB.RECENT, MyCommon.TabUsageType.Home, null);
                _statuses.AddTab(MyCommon.DEFAULTTAB.REPLY, MyCommon.TabUsageType.Mentions, null);
                _statuses.AddTab(MyCommon.DEFAULTTAB.DM, MyCommon.TabUsageType.DirectMessage, null);
                _statuses.AddTab(MyCommon.DEFAULTTAB.FAV, MyCommon.TabUsageType.Favorites, null);
            }
        }
Пример #27
0
 public static void LoadLocal()
 => SettingManager.Local = SettingLocal.Load();