當前位置: 首頁>>代碼示例>>C#>>正文


C# VersionControl.VersionInfo類代碼示例

本文整理匯總了C#中MonoDevelop.VersionControl.VersionInfo的典型用法代碼示例。如果您正苦於以下問題:C# VersionInfo類的具體用法?C# VersionInfo怎麽用?C# VersionInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VersionInfo類屬於MonoDevelop.VersionControl命名空間,在下文中一共展示了VersionInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: VersionControlItem

		public VersionControlItem (Repository repository, IWorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
		{
			Path = path;
			Repository = repository;
			WorkspaceObject = workspaceObject;
			IsDirectory = isDirectory;
			this.versionInfo = versionInfo;
		}
開發者ID:riverans,項目名稱:monodevelop,代碼行數:8,代碼來源:VersionControlItem.cs

示例2: Equals

		public bool Equals (VersionInfo obj)
		{
			if (obj == null)
				return false;
			return localPath == obj.localPath &&
				repositoryPath == obj.repositoryPath &&
				isDirectory == obj.isDirectory &&
				status == obj.status &&
				revision == obj.revision &&
				remoteStatus == obj.remoteStatus &&
				remoteRevision == obj.remoteRevision &&
				AllowedOperations == obj.AllowedOperations;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:13,代碼來源:VersionInfo.cs

示例3: Equals

		public bool Equals (VersionInfo obj)
		{
			if (obj == null)
				return false;
			return LocalPath == obj.LocalPath &&
				RepositoryPath == obj.RepositoryPath &&
				IsDirectory == obj.IsDirectory &&
				Status == obj.Status &&
				Revision == obj.Revision &&
				RemoteStatus == obj.RemoteStatus &&
				RemoteRevision == obj.RemoteRevision &&
				AllowedOperations == obj.AllowedOperations;
		}
開發者ID:FreeBSD-DotNet,項目名稱:monodevelop,代碼行數:13,代碼來源:VersionInfo.cs

示例4: SetStatus

		public void SetStatus (VersionInfo versionInfo, bool notify = true)
		{
			lock (fileStatus) {
				VersionInfo vi;
				if (fileStatus.TryGetValue (versionInfo.LocalPath, out vi) && vi.Equals (versionInfo)) {
					vi.RequiresRefresh = false;
					return;
				}
				versionInfo.Init (repo);
				fileStatus [versionInfo.LocalPath] = versionInfo;
			}
			if (notify)
				VersionControlService.NotifyFileStatusChanged (new FileUpdateEventArgs (repo, versionInfo.LocalPath, versionInfo.IsDirectory));
		}
開發者ID:wickedshimmy,項目名稱:monodevelop,代碼行數:14,代碼來源:VersionInfoCache.cs

示例5: VersionControlItem

		public VersionControlItem (Repository repository, WorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
		{
			Path = path;
			Repository = repository;
			WorkspaceObject = workspaceObject;
			IsDirectory = isDirectory;
			this.versionInfo = versionInfo;

			var obj = workspaceObject;
			while (obj != null) {
				var p = obj as Project;
				if (p != null)
					ContainerProject = p;

				obj = obj.ParentObject;
			}
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:17,代碼來源:VersionControlItem.cs

示例6: GetVersionInfo

		public override VersionInfo GetVersionInfo(FilePath localPath, bool getRemoteStatus)
		{
			if (!IsVersioned(localPath))
				return null;
			var status = GetLocalStatus(localPath);

			var vi = new VersionInfo(localPath, 
				localPath /*repositoryPath*/, 
				Directory.Exists(localPath), 
				status.VersionStatus, 
				new GitRevision(this, status.Revision), 
				VersionStatus.Unversioned, 
				null);

			return vi;
		}
開發者ID:yvanjanssens,項目名稱:monodevelop-git,代碼行數:16,代碼來源:GitRepository.cs

示例7: GenerateDiff

		public virtual DiffInfo GenerateDiff (FilePath baseLocalPath, VersionInfo versionInfo)
		{
			return null;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:4,代碼來源:Repository.cs

示例8: GetVersionInfo

		/// <summary>
		/// Returns the versioning status of a set of files or directories
		/// </summary>
		/// <param name='paths'>
		/// A list of files or directories
		/// </param>
		/// <param name='queryFlags'>
		/// Use VersionInfoQueryFlags enum for options.
		/// </param>
		public IEnumerable<VersionInfo> GetVersionInfo (IEnumerable<FilePath> paths, VersionInfoQueryFlags queryFlags = VersionInfoQueryFlags.None)
		{
			if ((queryFlags & VersionInfoQueryFlags.IgnoreCache) != 0) {
				// We shouldn't use IEnumerable because elements don't save property modifications.
				var res = OnGetVersionInfo (paths, (queryFlags & VersionInfoQueryFlags.IncludeRemoteStatus) != 0).ToList ();
				infoCache.SetStatus (res);
				return res;
			}
			List<FilePath> pathsToQuery = new List<FilePath> ();
			var result = new List<VersionInfo> ();
			foreach (var p in paths) {
				var vi = infoCache.GetStatus (p);
				if (vi != null) {
					result.Add (vi);
					// This status has been invalidated, query it asynchronously
					if (vi.RequiresRefresh)
						pathsToQuery.Add (p);
				}
				else {
					// If there is no cached status, query it asynchronously
					vi = new VersionInfo (p, "", Directory.Exists (p), VersionStatus.Versioned, null, VersionStatus.Versioned, null);
					infoCache.SetStatus (vi, false);
					result.Add (vi);
					pathsToQuery.Add (p);
				}
//				Console.WriteLine ("GetVersionInfo " + string.Join (", ", paths.Select (p => p.FullPath)));
			}
			if (pathsToQuery.Count > 0)
				AddQuery (new VersionInfoQuery () { Paths = pathsToQuery, QueryFlags = queryFlags });
			return result;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:40,代碼來源:Repository.cs

示例9: GetSupportedOperations

		internal protected virtual VersionControlOperation GetSupportedOperations (VersionInfo vinfo)
		{
			VersionControlOperation operations = VersionControlOperation.None;
			bool exists = !vinfo.LocalPath.IsNullOrEmpty && (File.Exists (vinfo.LocalPath) || Directory.Exists (vinfo.LocalPath));
			if (vinfo.IsVersioned) {
				operations = VersionControlOperation.Commit | VersionControlOperation.Update;
				if (!vinfo.HasLocalChange (VersionStatus.ScheduledAdd))
					operations |= VersionControlOperation.Log;

				if (exists) {
					if (!vinfo.HasLocalChange (VersionStatus.ScheduledDelete))
						operations |= VersionControlOperation.Remove;
					if (vinfo.HasLocalChanges || vinfo.IsDirectory)
						operations |= VersionControlOperation.Revert;
				}
				if (AllowLocking && !vinfo.IsDirectory) {
					if (!vinfo.HasLocalChanges && (vinfo.Status & VersionStatus.LockOwned) == 0)
						operations |= VersionControlOperation.Lock;
					if ((vinfo.Status & VersionStatus.LockOwned) != 0)
						operations |= VersionControlOperation.Unlock;
				}
			}
			else if (exists) {
				operations = VersionControlOperation.Add;
			}
			return operations;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:27,代碼來源:Repository.cs

示例10: SetDirectoryStatus

		public void SetDirectoryStatus (FilePath localDirectory, VersionInfo[] versionInfos, bool hasRemoteStatus)
		{
			lock (directoryStatus) {
				DirectoryStatus vis;
				if (directoryStatus.TryGetValue (localDirectory.CanonicalPath, out vis)) {
					if (versionInfos.Length == vis.FileInfo.Length && (hasRemoteStatus == vis.HasRemoteStatus)) {
						bool allEqual = false;
						for (int n=0; n<versionInfos.Length; n++) {
							if (!versionInfos[n].Equals (vis.FileInfo[n])) {
								allEqual = false;
								break;
							}
						}
						if (allEqual) {
							vis.RequiresRefresh = false;
							return;
						}
					}
				}
				directoryStatus [localDirectory.CanonicalPath] = new DirectoryStatus { FileInfo = versionInfos, HasRemoteStatus = hasRemoteStatus };
				SetStatus (versionInfos);
			}
		}
開發者ID:wickedshimmy,項目名稱:monodevelop,代碼行數:23,代碼來源:VersionInfoCache.cs

示例11: CreateVersionInfo

		static VersionInfo CreateVersionInfo (Repository repo, SvnStatusEventArgs ent)
		{
			VersionStatus rs = VersionStatus.Unversioned;
			Revision rr = null;

			// TODO: Fix remote status for Win32 Svn.
			if (ent.IsRemoteUpdated) {
				rs = ConvertStatus (SvnSchedule.Normal, ent.RemoteContentStatus);
				rr = new SvnRevision (repo, (int) ent.RemoteUpdateRevision, ent.RemoteUpdateCommitTime,
									  ent.RemoteUpdateCommitAuthor, "(unavailable)", null);
			}

			SvnSchedule sched = ent.WorkingCopyInfo != null ? ent.WorkingCopyInfo.Schedule : SvnSchedule.Normal;
			VersionStatus status = ConvertStatus (sched, ent.LocalContentStatus);

			bool readOnly = File.Exists (ent.FullPath) && (File.GetAttributes (ent.FullPath) & FileAttributes.ReadOnly) != 0;

			if (ent.WorkingCopyInfo != null) {
				if (ent.RemoteLock != null || ent.WorkingCopyInfo.LockToken != null) {
					status |= VersionStatus.LockRequired;
					if (ent.WorkingCopyInfo.LockToken != null || (ent.RemoteLock != null && ent.RemoteLock.Token != null))
						status |= VersionStatus.LockOwned;
					else
						status |= VersionStatus.Locked;
				}
				else if (readOnly)
					status |= VersionStatus.LockRequired;
			}

			string repoPath = ent.Uri != null ? ent.Uri.ToString () : null;
			SvnRevision newRev = null;
			if (ent.WorkingCopyInfo != null)
				newRev = new SvnRevision (repo, (int) ent.WorkingCopyInfo.Revision);

			VersionInfo ret = new VersionInfo (ent.FullPath, repoPath, ent.NodeKind == SvnNodeKind.Directory,
											   status, newRev,
											   rs, rr);
			return ret;
		}
開發者ID:llucenic,項目名稱:monodevelop,代碼行數:39,代碼來源:SvnSharpClient.cs

示例12: AddFile

		public ChangeSetItem AddFile (VersionInfo fileVersionInfo)
		{
			ChangeSetItem item = GetFileItem (fileVersionInfo.LocalPath);
			if (item != null)
				return item;

			item = new ChangeSetItem (fileVersionInfo);
			items.Add (item);
			return item;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:10,代碼來源:ChangeSet.cs

示例13: ChangeSetItem

		internal ChangeSetItem (VersionInfo versionInfo)
		{
			this.versionInfo = versionInfo;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:4,代碼來源:ChangeSet.cs

示例14: AddFiles

		public void AddFiles (VersionInfo[] fileVersionInfos)
		{
			foreach (VersionInfo vi in fileVersionInfos)
				AddFile (vi);
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:5,代碼來源:ChangeSet.cs

示例15: AddFile

		public ChangeSetItem AddFile (VersionInfo fileVersionInfo)
		{
			ChangeSetItem item = new ChangeSetItem (fileVersionInfo);
			items.Add (item);
			return item;
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:6,代碼來源:ChangeSet.cs


注:本文中的MonoDevelop.VersionControl.VersionInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。