• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Repository.RecentRepoSplitter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



RecentRepoSplitter类属于GitCommands.Repository命名空间,在下文中一共展示了RecentRepoSplitter类的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:Carbenium,项目名称: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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Repository.Repository类代码示例发布时间:2022-05-26
下一篇:
C# GitCommands.RevisionGraph类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap