本文整理汇总了C#中VersionControlItemList类的典型用法代码示例。如果您正苦于以下问题:C# VersionControlItemList类的具体用法?C# VersionControlItemList怎么用?C# VersionControlItemList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VersionControlItemList类属于命名空间,在下文中一共展示了VersionControlItemList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RevertInternal
private static bool RevertInternal (VersionControlItemList items, bool test)
{
try {
if (test) {
foreach (VersionControlItem item in items)
if (!item.Repository.CanRevert (item.Path))
return false;
return true;
}
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to revert the changes done in the selected files?"),
GettextCatalog.GetString ("All changes made to the selected files will be permanently lost."),
AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert)
return false;
new RevertWorker (items).Start();
return true;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
return false;
}
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:26,代码来源:RevertCommand.cs
示例2: Show
public static void Show (VersionControlItemList items)
{
foreach (VersionControlItem item in items) {
var document = IdeApp.Workbench.OpenDocument (item.Path);
DiffView.AttachViewContents (document, item);
document.Window.SwitchView (document.Window.FindView (typeof(BlameView)));
}
}
开发者ID:nickname100,项目名称:monodevelop,代码行数:8,代码来源:BlameView.cs
示例3: GetItems
protected VersionControlItemList GetItems ()
{
VersionControlItemList list = new VersionControlItemList ();
VersionControlItem it = GetItem ();
if (it != null)
list.Add (it);
return list;
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:8,代码来源:Commands.cs
示例4: Show
public static void Show (VersionControlItemList items)
{
foreach (VersionControlItem item in items) {
var document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
DiffView.AttachViewContents (document, item);
document.Window.SwitchView (document.Window.FindView (typeof (MergeView)));
}
}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:8,代码来源:MergeView.cs
示例5: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (!test) {
Show (items);
return true;
}
else
return items.Count > 0 && CanShow (items[0].Repository, items[0].Path);
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:9,代码来源:BlameView.cs
示例6: Revert
public static bool Revert (VersionControlItemList items, bool test)
{
if (RevertInternal (items, test)) {
foreach (var itemPath in items.Paths)
VersionControlService.SetCommitComment (itemPath, string.Empty, true);
return true;
}
return false;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:RevertCommand.cs
示例7: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (!test) {
Show (items);
return true;
}
else
return items.All (i => i.VersionInfo.CanAnnotate);
}
开发者ID:okrmartin,项目名称:monodevelop,代码行数:9,代码来源:BlameView.cs
示例8: CanShow
public static bool CanShow (VersionControlItemList items, Revision since)
{
bool found = false;
foreach (VersionControlItem item in items) {
if (item.Repository.IsHistoryAvailable (item.Path)) {
return true;
}
}
return found;
}
开发者ID:nickname100,项目名称:monodevelop,代码行数:10,代码来源:LogView.cs
示例9: Add
public static bool Add (VersionControlItemList items, bool test)
{
if (!items.All (i => i.VersionInfo.CanAdd))
return false;
if (test)
return true;
new AddWorker (items).Start();
return true;
}
开发者ID:telebovich,项目名称:monodevelop,代码行数:10,代码来源:AddRemoveMoveCommand.cs
示例10: Unlock
public static bool Unlock (VersionControlItemList items, bool test)
{
foreach (VersionControlItem it in items)
if (!it.Repository.CanUnlock (it.Path))
return false;
if (test)
return true;
new UnlockWorker (items).Start();
return true;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:11,代码来源:UnlockCommand.cs
示例11: Show
public static void Show (VersionControlItemList items, Revision since)
{
foreach (VersionControlItem item in items) {
if (!item.IsDirectory) {
var document = IdeApp.Workbench.OpenDocument (item.Path);
DiffView.AttachViewContents (document, item);
document.Window.SwitchView (document.Window.FindView (typeof(LogView)));
} else if (item.Repository.IsHistoryAvailable (item.Path)) {
new Worker (item.Repository, item.Path, item.IsDirectory, since).Start ();
}
}
}
开发者ID:nickname100,项目名称:monodevelop,代码行数:12,代码来源:LogView.cs
示例12: Show
public static void Show (VersionControlItemList items, Revision since)
{
foreach (VersionControlItem item in items) {
if (!item.IsDirectory) {
var document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
DiffView.AttachViewContents (document, item);
document.Window.SwitchView (document.Window.FindView (typeof(LogView)));
} else if (item.VersionInfo.CanLog) {
new Worker (item.Repository, item.Path, item.IsDirectory, since).Start ();
}
}
}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:12,代码来源:LogView.cs
示例13: Commit
public static bool Commit (VersionControlItemList items, bool test)
{
int filesToCommit = 0;
VersionControlItemList[] itemListsByRepo = items.SplitByRepository ();
foreach (VersionControlItemList itemList in itemListsByRepo) {
// Generate base folder path.
FilePath basePath = itemList.FindMostSpecificParent ();
Repository repo = itemList.First ().Repository;
ChangeSet cset = repo.CreateChangeSet (basePath);
cset.GlobalComment = VersionControlService.GetCommitComment (cset.BaseLocalPath);
foreach (var item in itemList) {
if (!item.VersionInfo.CanCommit)
continue;
if (item.Path.IsDirectory) {
// We don't run checks for directories, we throw dialog if there are no changes.
if (test)
return true;
foreach (VersionInfo vi in repo.GetDirectoryVersionInfo (item.Path, false, true))
if (vi.HasLocalChanges) {
filesToCommit++;
cset.AddFile (vi);
}
} else {
VersionInfo vi = repo.GetVersionInfo (item.Path);
if (vi.HasLocalChanges) {
if (test)
return true;
filesToCommit++;
cset.AddFile (vi);
}
}
}
// In case of no local changes.
if (test)
return false;
if (!cset.IsEmpty) {
Commit (repo, cset, false);
} else {
MessageService.ShowMessage (GettextCatalog.GetString ("There are no changes to be committed."));
continue;
}
}
return filesToCommit != 0;
}
开发者ID:wickedshimmy,项目名称:monodevelop,代码行数:52,代码来源:CommitCommand.cs
示例14: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
var document = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IMergeView> ());
}
return true;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:13,代码来源:MergeCommand.cs
示例15: Show
public static bool Show (VersionControlItemList items, Revision since, bool test)
{
bool found = false;
foreach (VersionControlItem item in items) {
if (item.Repository.IsHistoryAvailable (item.Path)) {
if (test)
return true;
found = true;
new Worker (item.Repository, item.Path, item.IsDirectory, since).Start ();
}
}
return found;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:LogView.cs
示例16: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (items.Count != 1)
return false;
VersionControlItem item = items [0];
if (item.VersionInfo.IsVersioned) {
if (test) return true;
StatusView d = new StatusView (item.Path, item.Repository);
IdeApp.Workbench.OpenDocument (d, true);
return true;
}
return false;
}
开发者ID:rohdef,项目名称:monodevelop,代码行数:14,代码来源:StatusView.cs
示例17: ResolveConflicts
public static async Task<bool> ResolveConflicts (VersionControlItemList list, bool test)
{
if (test)
return list.All (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted);
foreach (var item in list.Where (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted)) {
Document doc = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, true);
foreach (var view in doc.Views) {
if (view.GetContent <MergeView> () != null)
view.Select ();
}
}
return true;
}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:14,代码来源:ResolveConflictsCommand.cs
示例18: CreatePatch
/// <summary>
/// Creates a patch from a VersionControlItemList
/// </summary>
/// <param name="items">
/// A <see cref="VersionControlItemList"/> from which to create a patch.
/// </param>
/// <param name="test">
/// A <see cref="System.Boolean"/>: Whether this is a test run.
/// </param>
/// <returns>
/// A <see cref="System.Boolean"/>: Whether the patch creation succeeded.
/// </returns>
public static bool CreatePatch (VersionControlItemList items, bool test)
{
bool can = CanCreatePatch (items);
if (test || !can){ return can; }
FilePath basePath = items.FindMostSpecificParent (FilePath.Null);
if (FilePath.Empty == basePath)
return false;
ChangeSet cset = new ChangeSet (items[0].Repository, basePath);
foreach (VersionControlItem item in items) {
cset.AddFile (item.Path);
}
return CreatePatch (cset, test);
}
开发者ID:harishamdani,项目名称:monodevelop,代码行数:27,代码来源:CreatePatchCommand.cs
示例19: CreatePatch
/// <summary>
/// Creates a patch from a VersionControlItemList
/// </summary>
/// <param name="items">
/// A <see cref="VersionControlItemList"/> from which to create a patch.
/// </param>
/// <param name="test">
/// A <see cref="System.Boolean"/>: Whether this is a test run.
/// </param>
/// <returns>
/// A <see cref="System.Boolean"/>: Whether the patch creation succeeded.
/// </returns>
public static bool CreatePatch (VersionControlItemList items, bool test)
{
if (items.Count < 1)
return false;
FilePath basePath = FindMostSpecificParent (items, FilePath.Null);
if (FilePath.Empty == basePath)
return false;
ChangeSet cset = new ChangeSet (items[0].Repository, basePath);
foreach (VersionControlItem item in items) {
cset.AddFile (item.Path);
}
return CreatePatch (cset, test);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:27,代码来源:CreatePatchCommand.cs
示例20: GetItems
public VersionControlItemList GetItems ()
{
// Cached items are used only in the status view, not in the project pad.
if (items != null)
return items;
// Don't cache node items because they can change
VersionControlItemList nodeItems = new VersionControlItemList ();
foreach (ITreeNavigator node in CurrentNodes) {
VersionControlItem item = CreateItem (node.DataItem);
if (item != null)
nodeItems.Add (item);
}
return nodeItems;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:15,代码来源:VersionControlCommandHandler.cs
注:本文中的VersionControlItemList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论