• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ITextSourceVersion类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetCachedParseInformation

		public ParseInformation GetCachedParseInformation(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].CachedParseInformation;
			}
		}
开发者ID:kristjan84,项目名称:SharpDevelop,代码行数:12,代码来源:ParserServiceEntry.cs


示例17: CachedLine

            public CachedLine(HighlightedLine highlightedLine, ITextSourceVersion fileVersion)
            {
                if (highlightedLine == null)
                    throw new ArgumentNullException(nameof(highlightedLine));
                if (fileVersion == null)
                    throw new ArgumentNullException(nameof(fileVersion));

                HighlightedLine = highlightedLine;
                OldVersion = fileVersion;
                IsValid = true;
            }
开发者ID:mjheitland,项目名称:TableTweaker,代码行数:11,代码来源:RoslynSemanticHighlighter.cs


示例18: MoveOffsetTo

			public int MoveOffsetTo(ITextSourceVersion other, int oldOffset, AnchorMovementType movement)
			{
				int offset = oldOffset;
				foreach (var e in GetChangesTo(other)) {
					offset = e.GetNewOffset(offset, movement);
				}
				return offset;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:8,代码来源:TextSourceVersionProvider.cs


示例19: BelongsToSameDocumentAs

			public bool BelongsToSameDocumentAs(ITextSourceVersion other)
			{
				Version o = other as Version;
				return o != null && provider == o.provider;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:5,代码来源:TextSourceVersionProvider.cs


示例20: GetChangesTo

			public IEnumerable<TextChangeEventArgs> GetChangesTo(ITextSourceVersion other)
			{
				int result = CompareAge(other);
				Version o = (Version)other;
				if (result < 0)
					return GetForwardChanges(o);
				else if (result > 0)
					return o.GetForwardChanges(this).Reverse().Select(change => change.Invert());
				else
					return EmptyList<TextChangeEventArgs>.Instance;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:11,代码来源:TextSourceVersionProvider.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITextUndoHistoryRegistry类代码示例发布时间:2022-05-24
下一篇:
C# ITextSource类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap