protected override CompletionDataList GetAttributeValueCompletions(S.IAttributedXObject ob, S.XAttribute att)
        {
            var list = base.GetAttributeValueCompletions(ob, att) ?? new CompletionDataList();

            if (ob is S.XElement)
            {
                if (ob.Name.HasPrefix)
                {
                    string id = ob.GetId();
                    if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(id.Trim()))
                    {
                        id = null;
                    }
                    AddAspAttributeValueCompletionData(list, ob.Name, att.Name, id);
                }
            }
            else if (ob is AspNetDirective)
            {
                return(DirectiveCompletion.GetAttributeValues(project, Document.FileName, ob.Name.FullName, att.Name.FullName));
            }
            return(list.Count > 0? list : null);
        }
Example #2
0
        protected override CompletionDataList GetAttributeCompletions(S.IAttributedXObject attributedOb,
                                                                      Dictionary <string, string> existingAtts)
        {
            var list = base.GetAttributeCompletions(attributedOb, existingAtts) ?? new CompletionDataList();

            if (attributedOb is S.XElement)
            {
                if (!existingAtts.ContainsKey("runat"))
                {
                    list.Add("runat=\"server\"", "md-literal",
                             GettextCatalog.GetString("Required for ASP.NET controls.\n") +
                             GettextCatalog.GetString(
                                 "Indicates that this tag should be able to be\n" +
                                 "manipulated programmatically on the web server."));
                }

                if (!existingAtts.ContainsKey("id"))
                {
                    list.Add("id", "md-literal",
                             GettextCatalog.GetString("Unique identifier.\n") +
                             GettextCatalog.GetString(
                                 "An identifier that is unique within the document.\n" +
                                 "If the tag is a server control, this will be used \n" +
                                 "for the corresponding variable name in the CodeBehind."));
                }

                existingAtts["ID"] = "";
                if (attributedOb.Name.HasPrefix)
                {
                    AddAspAttributeCompletionData(list, attributedOb.Name, existingAtts);
                }
            }
            else if (attributedOb is AspNetDirective)
            {
                return(DirectiveCompletion.GetAttributes(project, attributedOb.Name.FullName, existingAtts));
            }
            return(list.Count > 0? list : null);
        }