当前位置: 首页>>代码示例>>C#>>正文


C# RecentRepoSplitter.SplitRecentRepos方法代码示例

本文整理汇总了C#中GitCommands.Repository.RecentRepoSplitter.SplitRecentRepos方法的典型用法代码示例。如果您正苦于以下问题:C# RecentRepoSplitter.SplitRecentRepos方法的具体用法?C# RecentRepoSplitter.SplitRecentRepos怎么用?C# RecentRepoSplitter.SplitRecentRepos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GitCommands.Repository.RecentRepoSplitter的用法示例。


在下文中一共展示了RecentRepoSplitter.SplitRecentRepos方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RefreshRepos

        private void RefreshRepos()
        {
            MostRecentLB.Items.Clear();
            LessRecentLB.Items.Clear();

            List<RecentRepoInfo> mostRecentRepos = new List<RecentRepoInfo>();
            List<RecentRepoInfo> lessRecentRepos = new List<RecentRepoInfo>();

            RecentRepoSplitter splitter = new RecentRepoSplitter();
            splitter.MaxRecentRepositories = (int)_NO_TRANSLATE_maxRecentRepositories.Value;
            splitter.ShorteningStrategy = GetShorteningStrategy();
            splitter.SortLessRecentRepos = sortLessRecentRepos.Checked;
            splitter.SortMostRecentRepos = sortMostRecentRepos.Checked;
            splitter.RecentReposComboMinWidth = (int)comboMinWidthEdit.Value;
            splitter.measureFont = MostRecentLB.Font;
            splitter.graphics = MostRecentLB.CreateGraphics();
            try
            {
                splitter.SplitRecentRepos(Repositories.RepositoryHistory.Repositories, mostRecentRepos, lessRecentRepos);
            }
            finally
            {
                splitter.graphics.Dispose();
            }

            foreach (RecentRepoInfo repo in mostRecentRepos)
                MostRecentLB.Items.Add(repo);

            foreach (RecentRepoInfo repo in lessRecentRepos)
                LessRecentLB.Items.Add(repo);
        }
开发者ID:robin521111,项目名称:gitextensions,代码行数:31,代码来源:FormRecentReposSettings.cs

示例2: WorkingdirDropDownOpening

        private void WorkingdirDropDownOpening(object sender, EventArgs e)
        {
            _NO_TRANSLATE_Workingdir.DropDownItems.Clear();

            List<RecentRepoInfo> mostRecentRepos = new List<RecentRepoInfo>();
            List<RecentRepoInfo> lessRecentRepos = new List<RecentRepoInfo>();

            using (var graphics = CreateGraphics())
            {
                var splitter = new RecentRepoSplitter
                {
                    measureFont = _NO_TRANSLATE_Workingdir.Font,
                    graphics = graphics
                };
                splitter.SplitRecentRepos(Repositories.RepositoryHistory.Repositories, mostRecentRepos, lessRecentRepos);
            }

            foreach (RecentRepoInfo repo in mostRecentRepos)
                AddWorkingdirDropDownItem(repo.Repo, repo.Caption);

            if (lessRecentRepos.Count > 0)
            {
                if (mostRecentRepos.Count > 0 && (Settings.SortMostRecentRepos || Settings.SortLessRecentRepos))
                    _NO_TRANSLATE_Workingdir.DropDownItems.Add(new ToolStripSeparator());

                foreach (RecentRepoInfo repo in lessRecentRepos)
                    AddWorkingdirDropDownItem(repo.Repo, repo.Caption);
            }

            _NO_TRANSLATE_Workingdir.DropDownItems.Add(new ToolStripSeparator());

            ToolStripMenuItem toolStripItem = new ToolStripMenuItem(openToolStripMenuItem.Text);
            toolStripItem.ShortcutKeys = openToolStripMenuItem.ShortcutKeys;
            _NO_TRANSLATE_Workingdir.DropDownItems.Add(toolStripItem);
            toolStripItem.Click += (hs, he) => OpenToolStripMenuItemClick(hs, he);

            toolStripItem = new ToolStripMenuItem(_configureWorkingDirMenu.Text);
            _NO_TRANSLATE_Workingdir.DropDownItems.Add(toolStripItem);
            toolStripItem.Click += (hs, he) =>
            {
                using (var frm = new FormRecentReposSettings()) frm.ShowDialog(this);
                RefreshWorkingDirCombo();
            };
        }
开发者ID:vitalybe,项目名称:gitextensions,代码行数:44,代码来源:FormBrowse.cs

示例3: RefreshWorkingDirCombo

        private void RefreshWorkingDirCombo()
        {
            Repository r = null;
            if (Repositories.RepositoryHistory.Repositories.Count > 0)
                r = Repositories.RepositoryHistory.Repositories[0];

            List<RecentRepoInfo> mostRecentRepos = new List<RecentRepoInfo>();

            if (r == null || !r.Path.Equals(Module.WorkingDir, StringComparison.InvariantCultureIgnoreCase))
                Repositories.AddMostRecentRepository(Module.WorkingDir);

            using (var graphics = CreateGraphics())
            {
                var splitter = new RecentRepoSplitter
                {
                    measureFont = _NO_TRANSLATE_Workingdir.Font,
                    graphics = graphics
                };
                splitter.SplitRecentRepos(Repositories.RepositoryHistory.Repositories, mostRecentRepos, mostRecentRepos);

                RecentRepoInfo ri = mostRecentRepos.Find((e) => e.Repo.Path.Equals(Module.WorkingDir, StringComparison.InvariantCultureIgnoreCase));

                if (ri == null)
                    _NO_TRANSLATE_Workingdir.Text = Module.WorkingDir;
                else
                    _NO_TRANSLATE_Workingdir.Text = ri.Caption;

                if (Settings.RecentReposComboMinWidth > 0)
                {
                    _NO_TRANSLATE_Workingdir.AutoSize = false;
                    var captionWidth = graphics.MeasureString(_NO_TRANSLATE_Workingdir.Text, _NO_TRANSLATE_Workingdir.Font).Width;
                    captionWidth = captionWidth + _NO_TRANSLATE_Workingdir.DropDownButtonWidth + 5;
                    _NO_TRANSLATE_Workingdir.Width = Math.Max(Settings.RecentReposComboMinWidth, (int)captionWidth);
                }
                else
                    _NO_TRANSLATE_Workingdir.AutoSize = true;
            }
        }
开发者ID:vitalybe,项目名称:gitextensions,代码行数:38,代码来源:FormBrowse.cs

示例4: RefreshWorkingDirCombo

        private void RefreshWorkingDirCombo()
        {
            if (Settings.RecentReposComboMinWidth > 0)
            {
                _NO_TRANSLATE_Workingdir.AutoSize = false;
                _NO_TRANSLATE_Workingdir.Width = Settings.RecentReposComboMinWidth;
            }
            else
                _NO_TRANSLATE_Workingdir.AutoSize = true;

            Repository r = null;
            if (Repositories.RepositoryHistory.Repositories.Count > 0)
                r = Repositories.RepositoryHistory.Repositories[0];

            List<RecentRepoInfo> mostRecentRepos = new List<RecentRepoInfo>();

            if (r == null || !r.Path.Equals(GitModule.CurrentWorkingDir, StringComparison.InvariantCultureIgnoreCase))
                Repositories.AddMostRecentRepository(GitModule.CurrentWorkingDir);

            using (var graphics = CreateGraphics())
            {
                var splitter = new RecentRepoSplitter
                {
                    measureFont = _NO_TRANSLATE_Workingdir.Font,
                    graphics = graphics
                };
                splitter.SplitRecentRepos(Repositories.RepositoryHistory.Repositories, mostRecentRepos, mostRecentRepos);
            }

            RecentRepoInfo ri = mostRecentRepos.Find((e) => e.Repo.Path.Equals(GitModule.CurrentWorkingDir, StringComparison.InvariantCultureIgnoreCase));

            if (ri == null)
                _NO_TRANSLATE_Workingdir.Text = GitModule.CurrentWorkingDir;
            else
                _NO_TRANSLATE_Workingdir.Text = ri.Caption;
        }
开发者ID:ascjones,项目名称:gitextensions,代码行数:36,代码来源:FormBrowse.cs

示例5: WorkingdirDropDownOpening

        private void WorkingdirDropDownOpening(object sender, EventArgs e)
        {
            _NO_TRANSLATE_Workingdir.DropDownItems.Clear();

            List<RecentRepoInfo> mostRecentRepos = new List<RecentRepoInfo>();
            List<RecentRepoInfo> lessRecentRepos = new List<RecentRepoInfo>();

            RecentRepoSplitter splitter = new RecentRepoSplitter();
            splitter.measureFont = _NO_TRANSLATE_Workingdir.Font;
            splitter.graphics = this.CreateGraphics();
            try
            {
                splitter.SplitRecentRepos(Repositories.RepositoryHistory.Repositories, mostRecentRepos, lessRecentRepos);
            }
            finally
            {
                splitter.graphics.Dispose();
            }

            foreach(RecentRepoInfo repo in mostRecentRepos)
                AddWorkingdirDropDownItem(repo.Repo, repo.Caption);

            if (lessRecentRepos.Count > 0)
            {
                if (mostRecentRepos.Count > 0 && (Settings.SortMostRecentRepos || Settings.SortLessRecentRepos))
                    _NO_TRANSLATE_Workingdir.DropDownItems.Add(new ToolStripSeparator());

                foreach (RecentRepoInfo repo in lessRecentRepos)
                    AddWorkingdirDropDownItem(repo.Repo, repo.Caption);
            }

            _NO_TRANSLATE_Workingdir.DropDownItems.Add(new ToolStripSeparator());
            ToolStripMenuItem toolStripItem = new ToolStripMenuItem("Configure this menu");
            _NO_TRANSLATE_Workingdir.DropDownItems.Add(toolStripItem);

            toolStripItem.Click += (object hs, EventArgs he) =>
            {
                new FormRecentReposSettings().ShowDialog(this);
                RefreshWorkingDirCombo();
            };
        }
开发者ID:JTidswell,项目名称:gitextensions,代码行数:41,代码来源:FormBrowse.cs

示例6: RefreshWorkingDirCombo

        private void RefreshWorkingDirCombo()
        {
            if (Settings.RecentReposComboMinWidth > 0)
            {
                _NO_TRANSLATE_Workingdir.AutoSize = false;
                _NO_TRANSLATE_Workingdir.Width = Settings.RecentReposComboMinWidth;
            }
            else
                _NO_TRANSLATE_Workingdir.AutoSize = true;

            Repository r = null;
            if (Repositories.RepositoryHistory.Repositories.Count > 0)
                r = Repositories.RepositoryHistory.Repositories[0];
            if (r == null || !r.Path.Equals(Settings.WorkingDir, StringComparison.InvariantCultureIgnoreCase))
                Repositories.AddMostRecentRepository(Settings.WorkingDir);

            List<RecentRepoInfo> mostRecentRepos = new List<RecentRepoInfo>();
            List<Repository> repo = new List<Repository>();
            repo.Add(Repositories.RepositoryHistory.Repositories[0]);

            RecentRepoSplitter splitter = new RecentRepoSplitter();
            splitter.measureFont = _NO_TRANSLATE_Workingdir.Font;
            splitter.graphics = this.CreateGraphics();
            try
            {
                splitter.SplitRecentRepos(repo, mostRecentRepos, mostRecentRepos);
            }
            finally
            {
                splitter.graphics.Dispose();
            }

            _NO_TRANSLATE_Workingdir.Text = mostRecentRepos[0].Caption;
        }
开发者ID:JTidswell,项目名称:gitextensions,代码行数:34,代码来源:FormBrowse.cs


注:本文中的GitCommands.Repository.RecentRepoSplitter.SplitRecentRepos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。