本文整理汇总了C#中GitCommands.Repository.Repository类的典型用法代码示例。如果您正苦于以下问题:C# Repository类的具体用法?C# Repository怎么用?C# Repository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Repository类属于GitCommands.Repository命名空间,在下文中一共展示了Repository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: HandleRssTag
private void HandleRssTag(XmlNode rssDoc, int r)
{
// <rss> tag found
var nodeRss = rssDoc.ChildNodes[r];
// Loop for the <channel> tag
for (var c = 0; c < nodeRss.ChildNodes.Count; c++)
{
// If it is the channel tag
if (nodeRss.ChildNodes[c].Name != "channel")
continue;
// <channel> tag found
var nodeChannel = nodeRss.ChildNodes[c];
// Set the labels with information from inside the nodes
/*string title = nodeChannel["title"].InnerText;
string link = nodeChannel["link"].InnerText;
string description = nodeChannel["description"].InnerText;*/
//loop through all items
for (var i = 0; i < nodeChannel.ChildNodes.Count; i++)
{
// If it is the item tag, then it has children tags which we will add as items to the ListView
if (nodeChannel.ChildNodes[i].Name != "item")
continue;
var nodeItem = nodeChannel.ChildNodes[i];
// 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();
var description = nodeItem["description"];
if (description != null)
repository.Description = description.InnerText.Trim();
var link = nodeItem["link"];
if (link != null)
repository.Path = link.InnerText.Trim();
repository.RepositoryType = RepositoryType.RssFeed;
Repositories.Add(repository);
}
}
}
开发者ID:TwistedHope,项目名称:gitextensions,代码行数:43,代码来源:RepositoryCategory.cs
示例17: repositoryRemoved
private void repositoryRemoved(Repository repository)
{
var handler = RepositoryRemoved;
if (handler != null)
handler(this, new RepositoryEventArgs(repository));
}
开发者ID:Carbenium,项目名称:gitextensions,代码行数:6,代码来源:DashboardCategory.cs
示例18: AddWorkingdirDropDownItem
private void AddWorkingdirDropDownItem(Repository repo, string caption)
{
ToolStripMenuItem toolStripItem = new ToolStripMenuItem(caption);
_NO_TRANSLATE_Workingdir.DropDownItems.Add(toolStripItem);
toolStripItem.Click += (hs, he) => ChangeWorkingDir(repo.Path);
if (repo.Title != null || !repo.Path.Equals(caption))
toolStripItem.ToolTipText = repo.Path;
}
开发者ID:vitalybe,项目名称:gitextensions,代码行数:10,代码来源:FormBrowse.cs
示例19: AddRepository
public void AddRepository(Repository repo)
{
Repositories.Add(repo);
}
开发者ID:TwistedHope,项目名称:gitextensions,代码行数:4,代码来源:RepositoryCategory.cs
示例20: DownloadRssFeed
public void DownloadRssFeed()
{
try
{
// Create a new XmlTextReader from the specified URL (RSS feed)
var rssReader = new XmlTextReader(RssFeedUrl);
var rssDoc = new XmlDocument();
// Load the XML content into a XmlDocument
rssDoc.Load(rssReader);
//Clear old entries
Repositories.Clear();
// Loop for the <rss> or (atom) <feed> tag
for (var r = 0; r < rssDoc.ChildNodes.Count; r++)
{
// If it is the (atom) feed tag
if (rssDoc.ChildNodes[r].Name == "feed")
{
HandleFeedTag(rssDoc, r);
}
// If it is the rss tag
if (rssDoc.ChildNodes[r].Name == "rss")
{
HandleRssTag(rssDoc, r);
}
}
}
catch (Exception ex)
{
Repositories.Clear();
var repository = new Repository
{
Title = "Error loading rssfeed from :" + RssFeedUrl,
Description = ex.Message,
Path = RssFeedUrl,
RepositoryType = RepositoryType.RssFeed
};
Repositories.Add(repository);
}
}
开发者ID:TwistedHope,项目名称:gitextensions,代码行数:44,代码来源:RepositoryCategory.cs
注:本文中的GitCommands.Repository.Repository类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论