Ejemplo n.º 1
0
        private void Execute(string path)
        {
            TabItem new_tab_item = new TabItem();
            var     tab_header   = new UserControls.RepositoryTabHeader(tabControl_);

            tab_header.SetRepositoryPath(path);
            new_tab_item.Header = tab_header;
            if (path == null)
            {
                new_tab_item.Content = new UserControls.NewTab((repo_path) => {
                    Debug.Assert(Util.IsValidGitDirectory(repo_path));
                    new_tab_item.Content = new RepositoryTab(repo_path);
                    tab_header.SetRepositoryPath(repo_path);
                });
            }
            else
            {
                Debug.Assert(Util.IsValidGitDirectory(path));
                new_tab_item.Content = new RepositoryTab(path);
            }

            tabControl_.Items.Insert(tabControl_.Items.Count - 1, new_tab_item);

            new_tab_item.Focus();
        }
Ejemplo n.º 2
0
        private void AddTab(string path, bool is_focused)
        {
            TabItem tab_item   = new TabItem();
            var     tab_header = new UserControls.RepositoryTabHeader(tab_control_);

            tab_header.Path.Content  = path;
            tab_header.Title.Content = Util.GetRepositoryName(path);
            tab_item.Header          = tab_header;
            tab_item.Content         = new RepositoryTab(path);

            tab_control_.Items.Insert(tab_control_.Items.Count - 1, tab_item);

            if (is_focused)
            {
                tab_item.Focus();
            }
        }