本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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"));
}
示例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 });
}
}
示例7: AddAllRazorSymbols
public static void AddAllRazorSymbols (CompletionDataList list)
{
if (list == null)
return;
AddRazorBeginExpressions (list);
AddRazorDirectives (list);
AddRazorTemplates (list);
}
示例8: GetElementCompletions
protected override void GetElementCompletions (CompletionDataList list)
{
AddMiscBeginTags (list);
XElement el;
var item = GetSchemaItem (out el);
if (item != null) {
item.GetElementCompletions (list, el);
}
}
示例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);
}
示例10: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
}
示例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);
}
示例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);
}
示例13: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("html", "http://foo/xhtml"));
htmlChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
}
示例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);
}
示例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);
}