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


C# CSharpCompletionTextEditorExtension类代码示例

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


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

示例1: Setup

		static CSharpTextEditorIndentation Setup (string input, out TestViewContent content)
		{
			TestWorkbenchWindow tww = new TestWorkbenchWindow ();
			content = new TestViewContent ();
			content.Data.Options.IndentStyle = IndentStyle.Auto;
			tww.ViewContent = content;
			content.ContentName = "a.cs";
			content.GetTextEditorData ().Document.MimeType = "text/x-csharp";

			Document doc = new Document (tww);

			var text = input;
			int endPos = text.IndexOf ('$');
			if (endPos >= 0)
				text = text.Substring (0, endPos) + text.Substring (endPos + 1);

			content.Text = text;
			content.CursorPosition = System.Math.Max (0, endPos);


			var compExt = new CSharpCompletionTextEditorExtension ();
			compExt.Initialize (doc);
			content.Contents.Add (compExt);
			
			var ext = new CSharpTextEditorIndentation ();
			CSharpTextEditorIndentation.OnTheFlyFormatting = true;
			ext.Initialize (doc);
			content.Contents.Add (ext);
			
			doc.UpdateParseDocument ();
			return ext;
		}
开发者ID:kjnilsson,项目名称:monodevelop,代码行数:32,代码来源:OnTheFlyFormatterTests.cs

示例2: DelegateDataProvider

		public DelegateDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IType delegateType)
		{
			this.startOffset = startOffset;
//			this.ext = ext;
			this.delegateType = delegateType;
			this.delegateMethod = delegateType.GetDelegateInvokeMethod ();
		}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:7,代码来源:DelegateDataProvider.cs

示例3: ImportSymbolCompletionData

		public ImportSymbolCompletionData (CSharpCompletionTextEditorExtension ext, RoslynCodeCompletionFactory factory, ISymbol type, bool useFullName) : base (null, factory, type)
		{
			this.completionExt = ext;
			this.useFullName = useFullName;
			this.type = type;
			this.DisplayFlags |= DisplayFlags.IsImportCompletion;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:7,代码来源:ImportSymbolCompletionData.cs

示例4: DelegateDataProvider

		public DelegateDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IType delegateType) : base (ext, startOffset)
		{
			compilation = ext.UnresolvedFileCompilation;
			file = ext.CSharpUnresolvedFile;
			//			this.delegateType = delegateType;
			this.delegateMethod = delegateType.GetDelegateInvokeMethod ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:DelegateDataProvider.cs

示例5: Setup

		static Document Setup (string input)
		{
			var tww = new TestWorkbenchWindow ();
			var content = new TestViewContent ();

			var project = new DotNetAssemblyProject ("C#");
			project.Name = "test";
			project.References.Add (new ProjectReference (ReferenceType.Package, "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
			project.References.Add (new ProjectReference (ReferenceType.Package, "System.Core"));

			project.FileName = "test.csproj";

			TypeSystemService.LoadProject (project);
			TypeSystemService.GetProjectContentWrapper (project).ReconnectAssemblyReferences (); 
			content.Project = project;

			tww.ViewContent = content;
			content.ContentName = "a.cs";
			content.GetTextEditorData ().Document.MimeType = "text/x-csharp";
			var doc = new Document (tww);

			var text = input;
			int endPos = text.IndexOf ('$');
			if (endPos >= 0)
				text = text.Substring (0, endPos) + text.Substring (endPos + 1);

			content.Text = text;
			content.CursorPosition = Math.Max (0, endPos);

			var compExt = new CSharpCompletionTextEditorExtension ();
			compExt.Initialize (doc);
			content.Contents.Add (compExt);
			doc.UpdateParseDocument ();
			return doc;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:35,代码来源:ResolveNamespaceTests.cs

示例6: ImportSymbolCompletionData

		public ImportSymbolCompletionData (CSharpCompletionTextEditorExtension ext, INamedTypeSymbol type, bool useFullName) : base (null, type.Name)
		{
			this.ext = ext;
			this.useFullName = useFullName;
			this.type = type;
			this.DisplayFlags |= DisplayFlags.IsImportCompletion;
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:7,代码来源:ImportSymbolCompletionData.cs

示例7: IndexerParameterDataProvider

		public IndexerParameterDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IType type, IEnumerable<IProperty> indexers, AstNode resolvedExpression) : base (ext, startOffset)
		{
			compilation = ext.UnresolvedFileCompilation;
			file = ext.CSharpUnresolvedFile;
			//			this.resolvedExpression = resolvedExpression;
			this.indexers = new List<IProperty> (indexers);
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:7,代码来源:IndexerParameterDataProvider.cs

示例8: Setup

		static Document Setup (string input)
		{
			TestWorkbenchWindow tww = new TestWorkbenchWindow ();
			var content = new TestViewContent ();
			tww.ViewContent = content;
			content.ContentName = "a.cs";
			content.GetTextEditorData ().Document.MimeType = "text/x-csharp";

			Document doc = new Document (tww);

			var text = input;
			int endPos = text.IndexOf ('$');
			if (endPos >= 0)
				text = text.Substring (0, endPos) + text.Substring (endPos + 1);

			content.Text = text;
			content.CursorPosition = System.Math.Max (0, endPos);

			var compExt = new CSharpCompletionTextEditorExtension ();
			compExt.Initialize (doc);
			content.Contents.Add (compExt);

			doc.UpdateParseDocument ();
			return doc;
		}
开发者ID:gary-b,项目名称:monodevelop,代码行数:25,代码来源:ResolveNamespaceTests.cs

示例9: AbstractParameterDataProvider

		public AbstractParameterDataProvider (CSharpCompletionTextEditorExtension ext, int startOffset)
		{
			if (ext == null)
				throw new ArgumentNullException ("ext");
			this.ext = ext;
			this.startOffset = startOffset;
		}
开发者ID:vac0,项目名称:monodevelop,代码行数:7,代码来源:AbstractParameterDataProvider.cs

示例10: IndexerParameterDataProvider

		public IndexerParameterDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IType type, AstNode resolvedExpression)
		{
			this.startOffset = startOffset;
//			this.ext = ext;
		
			this.resolvedExpression = resolvedExpression;
			indexers = new List<IProperty> (type.GetProperties (p => p.IsIndexer));
		}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:8,代码来源:IndexerParameterDataProvider.cs

示例11: RoslynCodeCompletionFactory

		public RoslynCodeCompletionFactory (CSharpCompletionTextEditorExtension ext, SemanticModel semanticModel)
		{
			if (ext == null)
				throw new ArgumentNullException ("ext");
			if (semanticModel == null)
				throw new ArgumentNullException ("semanticModel");
			this.semanticModel = semanticModel;
			this.ext = ext;
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:9,代码来源:RoslynCodeCompletionFactory.cs

示例12: Initialize

		public override void Initialize ()
		{
			CurrentPath = new PathEntry[] { new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = null } };
			isPathSet = false;
			UpdatePath (null, null);
			caret = Document.Editor.Caret;
			caret.PositionChanged += UpdatePath;
			ext = Document.GetContent<CSharpCompletionTextEditorExtension> ();
			ext.TypeSegmentTreeUpdated += HandleTypeSegmentTreeUpdated;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:10,代码来源:PathedDocumentTextEditorExtension.cs

示例13: NewOverrideCompletionData

		public NewOverrideCompletionData (CSharpCompletionTextEditorExtension ext, int declarationBegin, IUnresolvedTypeDefinition type, IMember member) : base (null)
		{
			this.ext = ext;
			this.type   = type;
			this.member = member;
			
			this.declarationBegin = declarationBegin;
			this.GenerateBody = true;
			this.Icon = member.GetStockIcon ();
			this.DisplayText = ambience.GetString (member, OutputFlags.IncludeParameters | OutputFlags.IncludeParameterName | OutputFlags.IncludeGenerics | OutputFlags.HideExtensionsParameter| OutputFlags.IncludeAccessor);
			this.CompletionText = member.EntityType == EntityType.Indexer ? "this" : member.Name;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:12,代码来源:NewOverrideCompletionData.cs

示例14: Initialize

		public override void Initialize ()
		{
			CurrentPath = new PathEntry[] { new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = null } };
			isPathSet = false;
			UpdateOwnerProjects ();
			UpdatePath (null, null);
			caret = Document.Editor.Caret;
			caret.PositionChanged += UpdatePath;
			ext = Document.GetContent<CSharpCompletionTextEditorExtension> ();
			ext.TypeSegmentTreeUpdated += HandleTypeSegmentTreeUpdated;
			IdeApp.Workspace.FileAddedToProject += HandleProjectChanged;
			IdeApp.Workspace.FileRemovedFromProject += HandleProjectChanged;
		}
开发者ID:jiailiuyan,项目名称:monodevelop,代码行数:13,代码来源:PathedDocumentTextEditorExtension.cs

示例15: BuildStub

		/// <summary>
		/// Builds a compileable stub file out of an entity.
		/// </summary>
		/// <returns>
		/// A string representing the stub
		/// </returns>
		/// <param name='memberStartOffset'>
		/// The offset where the member starts in the returned text.
		/// </param>
		static string BuildStub (MonoDevelop.Ide.Gui.Document data, CSharpCompletionTextEditorExtension.TypeSystemTreeSegment seg, int startOffset, int endOffset, out int memberStartOffset)
		{
			var pf = data.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
			if (pf == null) {
				memberStartOffset = 0;
				return null;
			}
			
			var sb = new StringBuilder ();
			
			int closingBrackets = 0;
			// use the member start location to determine the using scope, because this information is in sync, the position in
			// the file may have changed since last parse run (we have up 2 date locations from the type segment tree).
			var scope = pf.GetUsingScope (seg.Entity.Region.Begin);

			while (scope != null && !string.IsNullOrEmpty (scope.NamespaceName)) {
				// Hack: some syntax errors lead to invalid namespace names.
				if (scope.NamespaceName.EndsWith ("<invalid>")) {
					scope = scope.Parent;
					continue;
				}
				sb.Append ("namespace Stub {");
				sb.Append (data.Editor.EolMarker);
				closingBrackets++;
				while (scope.Parent != null && scope.Parent.Region == scope.Region)
					scope = scope.Parent;
				scope = scope.Parent;
			}

			var parent = seg.Entity.DeclaringTypeDefinition;
			while (parent != null) {
				sb.Append ("class " + parent.Name + " {");
				sb.Append (data.Editor.EolMarker);
				closingBrackets++;
				parent = parent.DeclaringTypeDefinition;
			}

			memberStartOffset = sb.Length;
			sb.Append (data.Editor.GetTextBetween (seg.Offset, endOffset));
			
			// Insert at least caret column eol markers otherwise the reindent of the generated closing bracket
			// could interfere with the current indentation.
			var endLocation = data.Editor.OffsetToLocation (endOffset);
			for (int i = 0; i <= endLocation.Column; i++) {
				sb.Append (data.Editor.EolMarker);
			}
			sb.Append (data.Editor.EolMarker);
			sb.Append (new string ('}', closingBrackets));
			
			return sb.ToString ();
		}
开发者ID:kthguru,项目名称:monodevelop,代码行数:60,代码来源:OnTheFlyFormatter.cs


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