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); } }
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; } }