public override INamed getRegistered(string name) { if (widgetFields != null) { WidgetField field = null; if (widgetFields.TryGetValue(name, out field)) { return(field); } } INamed actual = base.getRegistered(name); if (actual != null) { return(actual); } ConcreteCategoryDeclaration decl = getDeclaration(); MethodDeclarationMap methods = decl.getMemberMethods(this, name); if (methods != null && methods.Count > 0) { return(methods); } else if (decl.hasAttribute(this, name)) { return(getRegisteredDeclaration <AttributeDeclaration>(name)); } else { return(null); } }
public void RegisterWidgetField(String name, IType type, bool force) { if (widgetFields == null) { widgetFields = new Dictionary <String, WidgetField>(); } if (force || !widgetFields.ContainsKey(name)) { widgetFields[name] = new WidgetField(name, type); } else { throw new SyntaxError("Duplicate widget field " + name); } }