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

C# CompletionDataList类代码示例

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

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



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

		public virtual void GetElementCompletions (CompletionDataList list, XElement element)
		{
			if (children == null) {
				return;
			}

			foreach (var c in children) {
				list.Add (c.Key, null, c.Value.Description);
			}
		}
开发者ID:sushihangover,项目名称:MonoDevelop.AddinMaker,代码行数:10,代码来源:SchemaElement.cs


示例10: AddRazorTemplates

		private static void AddRazorTemplates (CompletionDataList list)
		{
			string icon = "md-template";
			list.Add ("inherits", icon, "Template for inherits directive");
			list.Add ("model", icon, "Template for model directive");
			list.Add ("helper", icon, "Template for helper directive");
			list.Add ("section", icon, "Template for section directive");
			list.Add ("functions", icon, "Template for functions directive");
			list.Add ("using", icon, "Template for using statement");
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:10,代码来源:RazorCompletion.cs


示例11: ShowCodeTemplatesCommand

        public virtual ICompletionDataList ShowCodeTemplatesCommand()
        {
            CompletionDataList list = new CompletionDataList();

            list.CompletionSelectionMode = CompletionSelectionMode.OwnTextField;

            foreach (CodeTemplate template in CodeTemplateService.Templates) //GetCodeTemplates("text/moscrif"))
                list.Add(new CodeTemplateCompletionData(template,this.editor));
            return list;
        }
开发者ID:moscrif,项目名称:ide,代码行数:10,代码来源:AutoCompleteActions.cs


示例12: InsertTemplate

        public void InsertTemplate(object obj, EventArgs args)
        {
            ICompletionDataList completionList = new CompletionDataList();

            completionList = ShowCodeTemplatesCommand();
            currentCompletionContext = widget.CreateCodeCompletionContext();//this.editor.Caret.Offset
            CompletionWindowManager.IsTemplateModes = true;
            CompletionWindowManager.ShowWindow((char)0, completionList, widget, currentCompletionContext, OnCompletionWindowClosed);
            editor.GrabFocus();
        }
开发者ID:moscrif,项目名称:ide,代码行数:10,代码来源:AutoCompleteActions.cs


示例13: AddRazorDirectives

		public static void AddRazorDirectives (CompletionDataList list)
		{
			string icon = "md-keyword";
			list.Add ("inherits", icon, "Defines a base class of the view");
			list.Add ("layout", icon, "Defines a layout file to use in this view");
			list.Add ("model", icon, "References a strongly-typed model");
			list.Add ("sessionstate", icon, "Defines a sessionstate mode");
			list.Add ("helper", icon, "Defines a helper");
			list.Add ("section", icon, "Defines a section");
			list.Add ("functions", icon, "Enables to define functions in this view");
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:11,代码来源:RazorCompletion.cs


示例14: HandleCodeCompletion

 public override ICompletionDataList HandleCodeCompletion(CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
 {
     var completionDataList = new CompletionDataList();
     sectionCompletion.FillCompletionList(completionDataList, completionContext, completionChar, ref triggerWordLength);
     directives.FillCompletionList(completionDataList, completionContext, completionChar, ref triggerWordLength);
     if(completionDataList.Count == 0)
     {
         return null;
     }
     return completionDataList;
 }
开发者ID:konrad-kruczynski,项目名称:rstcompletion,代码行数:11,代码来源:RstCompletionExtension.cs


示例15: HandleCodeCompletion

        public override ICompletionDataList HandleCodeCompletion(CodeCompletionContext completionContext, char triggerChar, ref int triggerWordLength)
        {
            var isLetter = char.IsLetter (triggerChar) || triggerChar == '_';

            if (char.IsDigit(triggerChar) || !EnableAutoCodeCompletion && isLetter)
                return null;

            if (isLetter)
            {
                if (completionContext.TriggerOffset > 1){
                    var prevChar = document.Editor.GetCharAt(completionContext.TriggerOffset - 2);
                    if(char.IsLetterOrDigit(prevChar) || prevChar =='_' || prevChar == '"' || prevChar == '#') // Don't trigger if we're already typing an identifier or if we're typing a string suffix (kinda hacky though)
                        return null;
                }
            }
            else if (!(triggerChar==' ' ||
                triggerChar == '@' ||
                triggerChar == '(' ||
                triggerChar == '.' ||
                triggerChar == '\0'))
                return null;

            triggerWordLength = isLetter ? 1 : 0;

            // Require a parsed D source

            var dom = base.Document.ParsedDocument as ParsedDModule;
            if (dom == null || dom.DDom == null)
                return null;

            updater.FinishUpdate();
            lastTriggerOffset = completionContext.TriggerOffset;
            var l = new CompletionDataList();

            if (D_Parser.Misc.CompletionOptions.Instance.EnableSuggestionMode)
            {
                l.AddKeyHandler(new SuggestionKeyHandler());
                l.AutoCompleteUniqueMatch = false;
                l.AutoCompleteEmptyMatch = false;
                l.AutoSelect = true;
            }
            else
                l.AddKeyHandler(new DoubleUnderScoreWorkaroundHandler(this));

            lock(dom.DDom)
                DCodeCompletionSupport.BuildCompletionData(
                    Document,
                    dom.DDom,
                    completionContext,
                    l,
                    triggerChar);

            return l.Count != 0 ? l : null;
        }
开发者ID:Geod24,项目名称:Mono-D,代码行数:54,代码来源:EditorCompletionExtension.cs


示例16: 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


示例17: 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


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CompletionItem类代码示例发布时间:2022-05-24
下一篇:
C# CompletionDataCollector类代码示例发布时间: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