public static RapidXamlElement AddChildrenAttribute(this RapidXamlElement element, string name, IEnumerable <RapidXamlElement> children, int startPos = -1, int length = -1) { var newAttr = new RapidXamlAttribute() { Name = name, IsInline = false, Location = new RapidXamlSpan(startPos, length) }; newAttr.Children.AddRange(children); element.Attributes.Add(newAttr); return(element); }
private void CheckForXmlns(string alias, RapidXamlElement element, RapidXamlAttribute ignorable, ref AnalysisActions actions) { var ns = element.Attributes.FirstOrDefault(a => a.ToString() == $"xmlns:{alias}=\"http:/uno.ui/{alias}\""); if (ns != null && !ignorable.StringValue.Contains(alias)) { actions.RemoveAttribute( RapidXamlErrorType.Warning, "RXT700", "xmlns '{0}' should be marked as ignorable.".WithParams(alias), "Mark {0} as ignorable".WithParams(alias), ignorable) .AndAddAttribute("mc:Ignorable", $"{ignorable.StringValue} {alias}"); } }