本文整理汇总了C#中VersionControlItemList类的典型用法代码示例。如果您正苦于以下问题:C# VersionControlItemList类的具体用法?C# VersionControlItemList怎么用?C# VersionControlItemList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VersionControlItemList类属于命名空间,在下文中一共展示了VersionControlItemList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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)));
}
}
示例3: GetItems
protected VersionControlItemList GetItems ()
{
VersionControlItemList list = new VersionControlItemList ();
VersionControlItem it = GetItem ();
if (it != null)
list.Add (it);
return list;
}
示例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)));
}
}
示例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);
}
示例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;
}
示例7: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (!test) {
Show (items);
return true;
}
else
return items.All (i => i.VersionInfo.CanAnnotate);
}
示例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;
}
示例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;
}
示例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;
}
示例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 ();
}
}
}
示例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 ();
}
}
}
示例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;
}
示例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;
}
示例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;
}