public static SetValue ( string setting, string value ) : void | ||
setting | string | |
value | string | |
Résultat | void |
private void LoadRepository(string url) { var git_url = Repository.FindRepository(url); if (git_url == null || !Repository.IsValid(git_url)) { MessageBox.Show("Given path doesn't seem to refer to a git repository: " + url); return; } var repo = new Repository(git_url); m_url_textbox.Text = git_url; UserSettings.SetValue(CURRENT_REPOSITORY, git_url); var head = repo.Head.Target as Commit; Debug.Assert(head != null); m_repository = repo; foreach (TabItem tab in m_tab_control.Items) { var repo_view = tab.Content as IRepositoryView; if (repo_view == null) { continue; } repo_view.Update(m_repository); } }
public MainFrame() { InitializeComponent(); m_url_textbox.Text = UserSettings.GetString(CURRENT_REPOSITORY); App.Language = UserSettings.GetString(CURRENT_Language); Loaded += (o, args) => Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => LoadRepository(m_url_textbox.Text))); Loaded += (s, e) => this.GoToChinese(); this.Closed += (s, e) => UserSettings.SetValue(CURRENT_Language, App.Language); }