void CompileExtensionElement(ExtensionEntity ext, string type, string key, UxlElement elm, Namescope[] usings) { if (elm.Type == UxlElementType.Require && _root.ElementDefinitions.Contains(key)) { ext.Requirements.Add(key, new Element(elm.Value.Source, elm.Value.String, elm.Disambiguation, usings)); } else { Log.Error(elm.Source, ErrorCode.E0000, "<" + elm.Type + " Key=\"" + key + "\"> is not valid in <" + type + "> (on this backend)"); } }
void CompileTypeElement(ExtensionEntity ext, string type, string key, UxlElement elm, Namescope[] usings) { if (elm.Type == UxlElementType.Require && _root.TypeElementDefinitions.Contains(key)) { ext.Requirements.Add(key, new Element(elm.Value.Source, elm.Value.String, elm.Disambiguation, usings)); } else { CompileExtensionElement(ext, type, key, elm, usings); } }
bool TryGetKey(UxlElement e, out string key) { if (string.IsNullOrEmpty(e.Key.String)) { Log.Error(e.Key.Source, ErrorCode.E0000, "<" + e.Type + "> must provide a non-empty 'Key' attribute"); key = null; return(false); } if (_deprecated.TryGetValue(e.Key.String, out key)) { Log.Warning(e.Key.Source, ErrorCode.W0000, e.Key.String.Quote() + " is deprecated -- please replace with " + key.Quote()); } else { key = e.Key.String; } return(true); }