public IList<HtmlCompletion> GetEntries(HtmlCompletionContext context) { List<HtmlCompletion> list = new List<HtmlCompletion>(); bool isValid = IsValid(context.Element); string name = context.Attribute != null ? context.Attribute.Name : string.Empty; int dotIndex = name.IndexOf('.'); if (isValid && dotIndex == -1 && context.Element.Name != "html" && context.Element.Name != "head" && context.Element.Name != "body") { var entry = new SimpleHtmlCompletion("repeat.for", context.Session); entry.IconSource = _icon; list.Add(entry); } if (dotIndex == -1) return list; if (isValid && !name.StartsWith("repeat.")) { list.Add(new SimpleHtmlCompletion("bind", "", name + "bind", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("two-way", "Force two-way data binding", name + "two-way", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("one-way", "Force one-way data binding", name + "one-way", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("one-time", "Force one-time data binding", name + "one-time", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("delegate", "Attaches a delegated event", name + "delegate", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("trigger", "Attaches an event to the element", name + "trigger", _icon, context.Session)); } return list; }
public IList <HtmlCompletion> GetEntries(HtmlCompletionContext context) { List <HtmlCompletion> list = new List <HtmlCompletion>(); bool isValid = IsValid(context.Element); string name = context.Attribute != null ? context.Attribute.Name : string.Empty; int dotIndex = name.IndexOf('.'); if (isValid && dotIndex == -1 && context.Element.Name != "html" && context.Element.Name != "head" && context.Element.Name != "body") { var entry = new SimpleHtmlCompletion("repeat.for", context.Session); entry.IconSource = _icon; list.Add(entry); } if (dotIndex == -1) { return(list); } if (isValid && !name.StartsWith("repeat.")) { list.Add(new SimpleHtmlCompletion("bind", "", name + "bind", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("two-way", "Force two-way data binding", name + "two-way", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("one-way", "Force one-way data binding", name + "one-way", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("one-time", "Force one-time data binding", name + "one-time", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("delegate", "Attaches a delegated event", name + "delegate", _icon, context.Session)); list.Add(new SimpleHtmlCompletion("trigger", "Attaches an event to the element", name + "trigger", _icon, context.Session)); } return(list); }