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


C# ITextSourceVersion类代码示例

本文整理汇总了C#中ITextSourceVersion的典型用法代码示例。如果您正苦于以下问题:C# ITextSourceVersion类的具体用法?C# ITextSourceVersion怎么用?C# ITextSourceVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ITextSourceVersion类属于命名空间,在下文中一共展示了ITextSourceVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StringTextSource

		/// <summary>
		/// Creates a new StringTextSource with the given text.
		/// </summary>
		public StringTextSource(string text, ITextSourceVersion version)
		{
			if (text == null)
				throw new ArgumentNullException("text");
			this.text = text;
			this.version = version;
		}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:10,代码来源:StringTextSource.cs

示例2: BelongsToSameDocumentAs

			public bool BelongsToSameDocumentAs(ITextSourceVersion other)
			{
				if (other == null)
					throw new ArgumentNullException("other");
				Version o = other as Version;
				return o != null && provider == o.provider;
			}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:7,代码来源:TextSourceVersionProvider.cs

示例3: RopeTextSource

		/// <summary>
		/// Creates a new RopeTextSource.
		/// </summary>
		public RopeTextSource(Rope<char> rope, ITextSourceVersion version)
		{
			if (rope == null)
				throw new ArgumentNullException("rope");
			this.rope = rope.Clone();
			this.version = version;
		}
开发者ID:AkshayVats,项目名称:SuperShell,代码行数:10,代码来源:RopeTextSource.cs

示例4: ParseInformation

 public ParseInformation(IUnresolvedFile unresolvedFile, ITextSourceVersion parsedVersion, bool isFullParseInformation)
 {
     if (unresolvedFile == null)
         throw new ArgumentNullException("unresolvedFile");
     this.unresolvedFile = unresolvedFile;
     this.parsedVersion = parsedVersion;
     this.isFullParseInformation = isFullParseInformation;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:8,代码来源:ParseInformation.cs

示例5: CSharpFullParseInformation

		public CSharpFullParseInformation(CSharpUnresolvedFile unresolvedFile, ITextSourceVersion parsedVersion, SyntaxTree compilationUnit)
			: base(unresolvedFile, parsedVersion, isFullParseInformation: true)
		{
			if (unresolvedFile == null)
				throw new ArgumentNullException("unresolvedFile");
			if (compilationUnit == null)
				throw new ArgumentNullException("compilationUnit");
			this.syntaxTree = compilationUnit;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:9,代码来源:CSharpFullParseInformation.cs

示例6: StringTextSource

		/// <summary>
		/// Creates a new StringTextSource with the given text.
		/// </summary>
		public StringTextSource (string text, ITextSourceVersion version, Encoding encoding = null, bool useBom = true)
		{
			if (text == null)
				throw new ArgumentNullException ("text");
			this.text = text;
			this.version = version;
			this.UseBOM = useBom;
			this.Encoding = encoding ?? Encoding.UTF8;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:12,代码来源:StringTextSource.cs

示例7: ImmutableTextTextSource

		public ImmutableTextTextSource (ImmutableText immutableText, System.Text.Encoding encoding, bool useBom, ITextSourceVersion version = null)
		{
			if (immutableText == null)
				throw new ArgumentNullException (nameof (immutableText));
			this.immutableText = immutableText;
			this.encoding = encoding;
			UseBOM = useBom;
			this.version = version;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:9,代码来源:ImmutableTextTextSource.cs

示例8: PatchedFile

 public PatchedFile(FileName fileName, IReadOnlyList<SearchResultMatch> matches, ITextSourceVersion oldVersion, ITextSourceVersion newVersion)
     : base(fileName, matches)
 {
     if (oldVersion == null)
         throw new ArgumentNullException("oldVersion");
     if (newVersion == null)
         throw new ArgumentNullException("newVersion");
     this.oldVersion = oldVersion;
     this.newVersion = newVersion;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:10,代码来源:SearchResultMatch.cs

示例9: CompareAge

			public int CompareAge(ITextSourceVersion other)
			{
				if (other == null)
					throw new ArgumentNullException("other");
				var o = other as Version;
				if (o == null || provider != o.provider)
					throw new ArgumentException("Versions do not belong to the same document.");
				// We will allow overflows, but assume that the maximum distance between checkpoints is 2^31-1.
				// This is guaranteed on x86 because so many checkpoints don't fit into memory.
				return Math.Sign(unchecked(id - o.id));
			}
开发者ID:VitalElement,项目名称:AvalonStudio,代码行数:11,代码来源:TextSourceVersionProvider.cs

示例10: GetReuseMapTo

		internal List<UnchangedSegment> GetReuseMapTo(ITextSourceVersion newVersion)
		{
			ITextSourceVersion oldVersion = this.Version;
			if (oldVersion == null || newVersion == null)
				return null;
			if (!oldVersion.BelongsToSameDocumentAs(newVersion))
				return null;
			List<UnchangedSegment> reuseMap = new List<UnchangedSegment>();
			reuseMap.Add(new UnchangedSegment(0, 0, this.TextLength));
			foreach (var change in oldVersion.GetChangesTo(newVersion)) {
				bool needsSegmentRemoval = false;
				for (int i = 0; i < reuseMap.Count; i++) {
					UnchangedSegment segment = reuseMap[i];
					if (segment.NewOffset + segment.Length <= change.Offset) {
						// change is completely after this segment
						continue;
					}
					if (change.Offset + change.RemovalLength <= segment.NewOffset) {
						// change is completely before this segment
						segment.NewOffset += change.InsertionLength - change.RemovalLength;
						reuseMap[i] = segment;
						continue;
					}
					// Change is overlapping segment.
					// Split segment into two parts: the part before change, and the part after change.
					var segmentBefore = new UnchangedSegment(segment.OldOffset, segment.NewOffset, change.Offset - segment.NewOffset);
					Debug.Assert(segmentBefore.Length < segment.Length);
					
					int lengthAtEnd = segment.NewOffset + segment.Length - (change.Offset + change.RemovalLength);
					var segmentAfter = new UnchangedSegment(
						segment.OldOffset + segment.Length - lengthAtEnd,
						change.Offset + change.InsertionLength,
						lengthAtEnd);
					Debug.Assert(segmentAfter.Length < segment.Length);
					Debug.Assert(segmentBefore.Length + segmentAfter.Length <= segment.Length);
					Debug.Assert(segmentBefore.NewOffset + segmentBefore.Length <= segmentAfter.NewOffset);
					Debug.Assert(segmentBefore.OldOffset + segmentBefore.Length <= segmentAfter.OldOffset);
					if (segmentBefore.Length > 0 && segmentAfter.Length > 0) {
						reuseMap[i] = segmentBefore;
						reuseMap.Insert(++i, segmentAfter);
					} else if (segmentBefore.Length > 0) {
						reuseMap[i] = segmentBefore;
					} else {
						reuseMap[i] = segmentAfter;
						if (segmentAfter.Length <= 0)
							needsSegmentRemoval = true;
					}
				}
				if (needsSegmentRemoval)
					reuseMap.RemoveAll(s => s.Length <= 0);
			}
			return reuseMap;
		}
开发者ID:sphynx79,项目名称:dotfiles,代码行数:53,代码来源:IncrementalParserState.cs

示例11: SnapshotDocument

			public SnapshotDocument (string text, ITextSourceVersion version) : base (new StringBuffer (text), new PrimitiveLineSplitter ())
			{
				this.version = version;
				Text = text;
				ReadOnly = true;
			}
开发者ID:telebovich,项目名称:monodevelop,代码行数:6,代码来源:TextDocument.cs

示例12: GetCachedParseInformation

		public ParseInformation GetCachedParseInformation(FileName fileName, ITextSourceVersion version, IProject parentProject)
		{
			var entry = GetFileEntry(fileName, false);
			if (entry != null)
				return entry.GetCachedParseInformation(version, parentProject);
			else
				return null;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:8,代码来源:ParserService.cs

示例13: GetExistingUnresolvedFile

		public IUnresolvedFile GetExistingUnresolvedFile(FileName fileName, ITextSourceVersion version, IProject parentProject)
		{
			var entry = GetFileEntry(fileName, false);
			if (entry != null)
				return entry.GetExistingUnresolvedFile(version, parentProject);
			else
				return null;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:8,代码来源:ParserService.cs

示例14: CompareVersions

		/// <summary>
		/// Compares currentVersion with version.
		/// -1 = currentVersion is older; 0 = same version; 1 = newVersion is older
		/// </summary>
		int CompareVersions(ITextSourceVersion newVersion)
		{
			if (currentVersion != null && newVersion != null && currentVersion.BelongsToSameDocumentAs(newVersion))
				return currentVersion.CompareAge(newVersion);
			else
				return -1;
		}
开发者ID:kristjan84,项目名称:SharpDevelop,代码行数:11,代码来源:ParserServiceEntry.cs

示例15: GetExistingUnresolvedFile

		public IUnresolvedFile GetExistingUnresolvedFile(ITextSourceVersion version, IProject parentProject)
		{
			lock (this) {
				if (version != null && CompareVersions(version) != 0) {
					return null;
				}
				int index = FindIndexForProject(parentProject);
				if (index < 0)
					return null;
				return entries[index].UnresolvedFile;
			}
		}
开发者ID:kristjan84,项目名称:SharpDevelop,代码行数:12,代码来源:ParserServiceEntry.cs


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