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


C# VersionControlItemList类代码示例

本文整理汇总了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;
			}
		}
开发者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


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