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


C# CompletionDataList类代码示例

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


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

示例1: GetDirectives

		//
		// NOTE: MS' documentation for directives is at http://msdn.microsoft.com/en-us/library/t8syafc7.aspx
		//
		// FIXME: gettextise this
		public static CompletionDataList GetDirectives (WebSubtype type)
		{
			CompletionDataList list = new CompletionDataList ();
			
			if (type == WebSubtype.WebForm) {
				list.Add ("Implements", null, "Declare that this page implements an interface.");
				list.Add ("Page", null, "Define properties of this page.");
				list.Add ("PreviousPageType", null, "Strongly type the page's PreviousPage property.");
				list.Add ("MasterType", null, "Strongly type the page's Master property.");
			} else if (type == WebSubtype.MasterPage) {
				list.Add ("Implements", null, "Declare that this master page implements an interface.");
				list.Add ("Master", null, "Define properties of this master page.");
				list.Add ("MasterType", null, "Strongly type the page's Master property.");
			} else if (type == WebSubtype.WebControl) {
				list.Add ("Control", null, "Define properties of this user control.");
				list.Add ("Implements", null, "Declare that this control implements an interface.");
			} else {
				return null;
			}
			
			list.Add ("Assembly", null, "Reference an assembly.");
			list.Add ("Import", null, "Import a namespace.");
			
			if (type != WebSubtype.MasterPage) {
				list.Add ("OutputCache", null, "Set output caching behaviour.");
			}
			
			list.Add ("Reference", null, "Reference a page or user control.");
			list.Add ("Register", null, "Register a user control or custom web controls.");
			
			return list.Count > 0? list : null;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:36,代码来源:Directive.cs

示例2: GetElementCompletions

		protected override  Task<CompletionDataList> GetElementCompletions (CancellationToken token)
		{
			var list = new CompletionDataList ();

			AddMiscBeginTags (list);

			var path = GetCurrentPath ();

			if (path.Count == 0) {
				list.Add (new XmlCompletionData ("Project", XmlCompletionData.DataType.XmlElement));
				return Task.FromResult (list);
			}

			var rr = ResolveElement (path);
			if (rr == null)
				return Task.FromResult (list);

			foreach (var c in rr.BuiltinChildren)
				list.Add (new XmlCompletionData (c, XmlCompletionData.DataType.XmlElement));

			var inferredChildren = GetInferredChildren (rr);
			if (inferredChildren != null)
				foreach (var c in inferredChildren)
					list.Add (new XmlCompletionData (c, XmlCompletionData.DataType.XmlElement));
			return Task.FromResult (list);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:26,代码来源:MSBuildTextEditorExtension.cs

示例3: HandleCodeCompletion

        public override ICompletionDataList HandleCodeCompletion(CodeCompletionContext completionContext, char triggerChar, ref int triggerWordLength)
        {
            var l = new CompletionDataList();

            if (!(triggerChar==' ' ||
                char.IsLetter(triggerChar) ||
                triggerChar == '@' ||
                triggerChar == '(' ||
                triggerChar == '_' ||
                triggerChar == '.' ||
                triggerChar == '\0'))
                return l;

            triggerWordLength = (char.IsLetter(triggerChar) || triggerChar=='_' || triggerChar=='@') ? 1 : 0;

            // Require a parsed D source

            var dom = base.Document.ParsedDocument as ParsedDModule;
            if (dom != null && dom.DDom!=null)
                lock(dom.DDom)
                DCodeCompletionSupport.BuildCompletionData(
                    Document,
                    dom.DDom,
                    completionContext,
                    l,
                    triggerChar);

            return l;
        }
开发者ID:robik,项目名称:Mono-D,代码行数:29,代码来源:EditorCompletionExtension.cs

示例4: GetPathCompletion

		CompletionDataList GetPathCompletion (string subPath)
		{
			CompletionContext ctx = GetCompletionContext (1);
			if (!(ctx is ExtensionCompletionContext))
				return null;
			ModuleCompletionContext mc = (ModuleCompletionContext) ctx.GetParentContext (typeof(ModuleCompletionContext));
			
			Set<string> paths = new Set<string> ();
			CompletionDataList cp = new CompletionDataList ();
			foreach (AddinDependency adep in mc.Module.Dependencies) {
				Addin addin = registry.GetAddin (adep.FullAddinId);
				if (addin != null && addin.Description != null) {
					foreach (ExtensionPoint ep in addin.Description.ExtensionPoints) {
						if (ep.Path.StartsWith (subPath)) {
							string spath = ep.Path.Substring (subPath.Length);
							int i = spath.IndexOf ('/');
							if (i != -1)
								spath = spath.Substring (0, i);
							if (paths.Add (spath)) {
								if (i == -1) // Full match. Add the documentation
									cp.Add (spath, "md-extension-point", ep.Name + "\n" + ep.Description);
								else
									cp.Add (spath, "md-literal");
							}
						}
					}
				}
			}
			return cp;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:30,代码来源:CodeCompletionExtension.cs

示例5: AddRazorBeginExpressions

		public static void AddRazorBeginExpressions (CompletionDataList list)
		{
			string icon = "md-literal";
			list.Add ("{", icon, GettextCatalog.GetString ("Razor code block"));
			list.Add ("*", icon, GettextCatalog.GetString ("Razor comment"));
			list.Add ("(", icon, GettextCatalog.GetString ("Razor explicit expression"));
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:7,代码来源:RazorCompletion.cs

示例6: GetAttributeCompletions

		public override void GetAttributeCompletions (CompletionDataList list, IAttributedXObject attributedOb, Dictionary<string, string> existingAtts)
		{
			var required = new NodeCompletionCategory ("Required", 0);
			var optional = new NodeCompletionCategory ("Optional", 1);

			foreach (NodeTypeAttribute att in info.Attributes) {
				if (!existingAtts.ContainsKey (att.Name)) {
					var data = new NodeTypeAttributeCompletionData (att) {
						CompletionCategory = att.Required ? required : optional
					};
					list.Add (data);
				}
			}

			var ordering = new NodeCompletionCategory ("Ordering", 2);
			if (!existingAtts.ContainsKey ("id")) {
				list.Add (new CompletionData ("id", null, "ID for the extension, unique in this extension point.") { CompletionCategory = ordering });
			}
			if (!existingAtts.ContainsKey ("insertbefore")) {
				list.Add (new CompletionData ("insertbefore", null, "ID of an existing extension before which to insert this.") { CompletionCategory = ordering });
			}
			if (!existingAtts.ContainsKey ("insertafter")) {
				list.Add (new CompletionData ("insertafter", null, "ID of an existing extension after which to insert this.") { CompletionCategory = ordering });
			}
		}
开发者ID:sushihangover,项目名称:MonoDevelop.AddinMaker,代码行数:25,代码来源:ExtensionNodeElement.cs

示例7: AddAllRazorSymbols

		public static void AddAllRazorSymbols (CompletionDataList list)
		{
			if (list == null)
				return;
			AddRazorBeginExpressions (list);
			AddRazorDirectives (list);
			AddRazorTemplates (list);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:8,代码来源:RazorCompletion.cs

示例8: GetElementCompletions

		protected override void GetElementCompletions (CompletionDataList list)
		{
			AddMiscBeginTags (list);

			XElement el;
			var item = GetSchemaItem (out el);
			if (item != null) {
				item.GetElementCompletions (list, el);
			}
		}
开发者ID:Therzok,项目名称:MonoDevelop.AddinMaker,代码行数:10,代码来源:SchemaBasedEditorExtension.cs

示例9: FixtureInit

		public override void FixtureInit()
		{
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("root", "http://foo"));
			path.Elements.Add(new QualifiedName("bar", "http://foo"));
			barElementAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:MissingSchemaElementTestFixture.cs

示例10: FixtureInit

		public override void FixtureInit()
		{			
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
			
			noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:7,代码来源:ChoiceTestFixture.cs

示例11: Init

		async Task Init ()
		{
			if (schemaChildElements != null)
				return;
			
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("schema", "http://www.w3.org/2001/XMLSchema"));
			
			schemaChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
			//schemaAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
			
			// Get include elements attributes.
			path.Elements.Add(new QualifiedName("include", "http://www.w3.org/2001/XMLSchema"));
			includeAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
		
			// Get annotation element info.
			path.Elements.RemoveAt(path.Elements.Count - 1);
			path.Elements.Add(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));
			
			annotationChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
			annotationAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
		
			// Get app info attributes.
			path.Elements.Add(new QualifiedName("appinfo", "http://www.w3.org/2001/XMLSchema"));
			appInfoAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
			
			// Get foo attributes.
			path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("foo", "http://www.w3.org/2001/XMLSchema"));
			fooAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:31,代码来源:ExtensionElementTestFixture.cs

示例12: FixtureInit

		public override void FixtureInit()
		{
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("schema", "http://www.w3.org/2001/XMLSchema"));
			
			schemaChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
			//schemaAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
			
			// Get include elements attributes.
			path.Elements.Add(new QualifiedName("include", "http://www.w3.org/2001/XMLSchema"));
			includeAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
		
			// Get annotation element info.
			path.Elements.RemoveLast();
			path.Elements.Add(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));
			
			annotationChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
			annotationAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
		
			// Get app info attributes.
			path.Elements.Add(new QualifiedName("appinfo", "http://www.w3.org/2001/XMLSchema"));
			appInfoAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
			
			// Get foo attributes.
			path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("foo", "http://www.w3.org/2001/XMLSchema"));
			fooAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:ExtensionElementTestFixture.cs

示例13: FixtureInit

		public override void FixtureInit()
		{
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("html", "http://foo/xhtml"));
		
			htmlChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
		}		
开发者ID:brantwedel,项目名称:monodevelop,代码行数:7,代码来源:DuplicateElementTestFixture.cs

示例14: Init

		async Task Init ()
		{
			if (barAttributeValuesCompletionData != null)
				return;
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
			barAttributeValuesCompletionData = await SchemaCompletionData.GetAttributeValueCompletionData(path, "bar", CancellationToken.None);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:AttributeValueAnnotationTestFixture.cs

示例15: Init

		async Task Init ()
		{
			if (attributes != null)
				return;
			XmlElementPath path = new XmlElementPath();
			path.Elements.Add(new QualifiedName("html", "http://foo/xhtml"));
			attributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:8,代码来源:AttributeRefTestFixture.cs


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