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


C# Repository.Repository类代码示例

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


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

示例1: RecentRepoInfo

        public RecentRepoInfo(Repository aRepo, bool aMostRecent)
        {
            Repo = aRepo;
            MostRecent = aMostRecent;
            try
            {
                DirInfo = new DirectoryInfo(Repo.Path);
            }
            catch (SystemException)
            {
                DirInfo = null;
                Caption = Repo.Path;
            }

            if (Repo.Title != null)
                ShortName = Repo.Title;
            else if (DirInfo != null)
                ShortName = DirInfo.Name;
            

            if (DirInfo != null)
                DirInfo = DirInfo.Parent;

            DirName = DirInfo == null ? "" : DirInfo.FullName;
        }
开发者ID:HuChundong,项目名称:gitextensions,代码行数:25,代码来源:RecentRepoInfo.cs

示例2: Assign

 public void Assign(Repository source)
 {
     Path = source.Path;
     Title = source.Title;
     Description = source.Description;
     RepositoryType = source.RepositoryType;
 }
开发者ID:JTidswell,项目名称:gitextensions,代码行数:7,代码来源:Repository.cs

示例3: AddMostRecentRepository

        public void AddMostRecentRepository(string repo)
        {
            repo = repo.Trim();

            if (string.IsNullOrEmpty(repo))
                return;

            repo = repo.Replace('/', '\\');
            if (!repo.EndsWith("\\") &&
                !repo.StartsWith("http", StringComparison.CurrentCultureIgnoreCase) &&
                !repo.StartsWith("git", StringComparison.CurrentCultureIgnoreCase) &&
                !repo.StartsWith("ssh", StringComparison.CurrentCultureIgnoreCase))
                repo += "\\";

            foreach (var recentRepository in Repositories)
            {
                if (!recentRepository.Path.Equals(repo, StringComparison.CurrentCultureIgnoreCase))
                    continue;
                Repositories.Remove(recentRepository);
                break;
            }

            var repository = new Repository(repo, null, null) {RepositoryType = RepositoryType.History};
            Repositories.Insert(0, repository);

            if (Repositories.Count > 30)
            {
                Repositories.RemoveAt(30);
            }
        }
开发者ID:TwistedHope,项目名称:gitextensions,代码行数:30,代码来源:RepositoryHistory.cs

示例4: DashboardItem

        public DashboardItem(Repository repository)
            : this()
        {
            if (repository == null)
                return;

            Bitmap icon = GetRepositoryIcon(repository);


            if (AppSettings.DashboardShowCurrentBranch)
            {
                _branchNameLoader = new AsyncLoader();
                _branchNameLoader.Load(() =>
                {
                    if (!GitCommands.GitModule.IsBareRepository(repository.Path))
                    {
                        return GitModule.GetSelectedBranchFast(repository.Path);
                    }
                    return string.Empty;
                },
                UpdateBranchName);
            }

            Initialize(icon, repository.Path, repository.Title, repository.Description);
        }
开发者ID:Carbenium,项目名称:gitextensions,代码行数:25,代码来源:DashboardItem.cs

示例5: Assign

 public void Assign(Repository source)
 {
     if (source == null)
         return;
     Path = source.Path;
     Title = source.Title;
     Description = source.Description;
     RepositoryType = source.RepositoryType;
 }
开发者ID:Carbenium,项目名称:gitextensions,代码行数:9,代码来源:Repository.cs

示例6: DashboardItem

        public DashboardItem(Repository repository)
            : this()
        {
            if (repository == null)
                return;

            Bitmap icon = GetRepositoryIcon(repository);

            var branchName = GitCommands.GitCommandHelpers.GetSelectedBranch(repository.Path);
            Initialize(icon, repository.Path, repository.Title, repository.Description, branchName);
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
开发者ID:binhu,项目名称:gitextensions,代码行数:12,代码来源:DashboardItem.cs

示例7: GetRepositoryIcon

 private static Bitmap GetRepositoryIcon(Repository repository)
 {
     switch (repository.RepositoryType)
     {
         case RepositoryType.Repository:
             return Resources._14;
         case RepositoryType.RssFeed:
             return Resources.rss.ToBitmap();
         case RepositoryType.History:
             return Resources.history.ToBitmap();
         default:
             throw new ArgumentException("Repository type is not supported.", "repository");
     }
 }
开发者ID:sopolenius,项目名称:gitextensions,代码行数:14,代码来源:DashboardItem.cs

示例8: DashboardItem

        public DashboardItem(Repository repository)
            : this()
        {
            if (repository == null)
                return;

            Bitmap icon = GetRepositoryIcon(repository);

            string branchName = string.Empty;

            if (GitCommands.Settings.DashboardShowCurrentBranch)
            {
                if (!GitCommands.GitCommandHelpers.IsBareRepository(repository.Path))
                    branchName = GitCommands.GitCommandHelpers.GetSelectedBranchFast(repository.Path);
            }

            Initialize(icon, repository.Path, repository.Title, repository.Description, branchName);
        }
开发者ID:sopolenius,项目名称:gitextensions,代码行数:18,代码来源:DashboardItem.cs

示例9: DashboardItem

        public DashboardItem(Repository repository)
        {
            InitializeComponent(); Translate();

            if (repository == null)
                return;

            Bitmap icon = null;
            if (repository.RepositoryType == RepositoryType.RssFeed)
                icon = Resources.rss.ToBitmap();
            if (repository.RepositoryType == RepositoryType.Repository)
                icon = Resources._14;
            if (repository.RepositoryType == RepositoryType.History)
                icon = Resources.history.ToBitmap();

            Initialize(icon, repository.Path, repository.Title, repository.Description);
            this.AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
开发者ID:jystic,项目名称:gitextensions,代码行数:18,代码来源:DashboardItem.cs

示例10: AddMostRecentRepository

        public void AddMostRecentRepository(string repo)
        {
            if (string.IsNullOrEmpty(repo))
                return;

            repo = repo.Trim();

            if (string.IsNullOrEmpty(repo))
                return;

            repo = repo.Replace(Settings.PathSeparatorWrong, Settings.PathSeparator);
            if (!repo.EndsWith(Settings.PathSeparator.ToString()) &&
                !repo.StartsWith("http", StringComparison.CurrentCultureIgnoreCase) &&
                !repo.StartsWith("git", StringComparison.CurrentCultureIgnoreCase) &&
                !repo.StartsWith("ssh", StringComparison.CurrentCultureIgnoreCase))
                repo += Settings.PathSeparator.ToString();

            Repository.RepositoryAnchor anchor = Repository.RepositoryAnchor.None;
            foreach (var recentRepository in Repositories)
            {
                if (!recentRepository.Path.Equals(repo, StringComparison.CurrentCultureIgnoreCase))
                    continue;
                anchor = recentRepository.Anchor;
                Repositories.Remove(recentRepository);
                break;
            }

            var repository = new Repository(repo, null, null) {
                RepositoryType = RepositoryType.History,
                Anchor = anchor
            };
            Repositories.Insert(0, repository);

            if (Repositories.Count > 30)
            {
                Repositories.RemoveAt(30);
            }
        }
开发者ID:dominiqueplante,项目名称:gitextensions,代码行数:38,代码来源:RepositoryHistory.cs

示例11: AddMostRecentRepository

        public void AddMostRecentRepository(string repo)
        {
            if (string.IsNullOrEmpty(repo))
                return;

            repo = repo.Trim();

            if (string.IsNullOrEmpty(repo))
                return;

            if (!Repository.PathIsUrl(repo))
            {
                repo = repo.ToNativePath().EnsureTrailingPathSeparator();
            }

            Repository.RepositoryAnchor anchor = Repository.RepositoryAnchor.None;
            foreach (var recentRepository in Repositories)
            {
                if (!recentRepository.Path.Equals(repo, StringComparison.CurrentCultureIgnoreCase))
                    continue;
                anchor = recentRepository.Anchor;
                Repositories.Remove(recentRepository);
                break;
            }

            var repository = new Repository(repo, null, null) {
                RepositoryType = RepositoryType.History,
                Anchor = anchor
            };
            Repositories.Insert(0, repository);

            while (MaxCount > 0 && Repositories.Count > MaxCount)
            {
                Repositories.RemoveAt(MaxCount);
            }
        }
开发者ID:Carbenium,项目名称:gitextensions,代码行数:36,代码来源:RepositoryHistory.cs

示例12: repositoryRemoved

 private void repositoryRemoved(Repository repository)
 {
     if (RepositoryRemoved != null)
         RepositoryRemoved(repository);
 }
开发者ID:pcworld,项目名称:gitextensions,代码行数:5,代码来源:DashboardCategory.cs

示例13: contextMenu_Opening

 void contextMenu_Opening(object sender, EventArgs e)
 {
     repository = (Repository)(((ContextMenuStrip)sender).SourceControl.Tag);
 }
开发者ID:pcworld,项目名称:gitextensions,代码行数:4,代码来源:DashboardCategory.cs

示例14: RemoveRepository

 public void RemoveRepository(Repository repository)
 {
     Repositories.Remove(repository);
 }
开发者ID:TwistedHope,项目名称:gitextensions,代码行数:4,代码来源:RepositoryCategory.cs

示例15: HandleFeedTag

        private void HandleFeedTag(XmlNode rssDoc, int r)
        {
            // <feed> tag found
            var nodeFeed = rssDoc.ChildNodes[r];

            //loop through all entries
            for (var i = 0; i < nodeFeed.ChildNodes.Count; i++)
            {
                var nodeItem = nodeFeed.ChildNodes[i];

                if (nodeItem.Name != "entry")
                    continue;
                // Create a new row in the ListView containing information from inside the nodes
                var repository = new Repository();
                var title = nodeItem["title"];
                if (title != null)
                    repository.Title = title.InnerText.Trim();
                //repository.Description = nodeItem["content"].InnerText.Trim();
                var link = nodeItem["link"];
                if (link != null)
                    repository.Path = link.Attributes["href"].Value;
                repository.RepositoryType = RepositoryType.RssFeed;
                Repositories.Add(repository);
            }
        }
开发者ID:TwistedHope,项目名称:gitextensions,代码行数:25,代码来源:RepositoryCategory.cs


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