public static imbHelpContent getHelpContent(this imbAttributeCollection attribs) { imbHelpContent output = new imbHelpContent(); foreach (Object k in attribs.Keys) { if (k is imbAttributeName) { imbAttribute att = attribs[k]; switch (att.nameEnum) { case imbAttributeName.menuCommandTitle: case imbAttributeName.helpTitle: output.title = att.getMessage().toStringSafe(); break; case imbAttributeName.helpTips: output.hints = att.msg.toStringSafe(); break; case imbAttributeName.helpPurpose: output.purpose = att.msg.toStringSafe(); break; case imbAttributeName.menuHelp: case imbAttributeName.helpDescription: output.description = att.msg.toStringSafe(); break; } } } return(output); }
/// <summary> /// dodaje novi attribut u kolekciju /// </summary> /// <param name="newAttribute"></param> public void AddNewAttribute(imbAttribute newAttribute) { if (ContainsKey(newAttribute.nameEnum)) { this[newAttribute.nameEnum] = newAttribute; } else { Add(newAttribute.nameEnum, newAttribute); } }
public imbAttribute this[Object key] { get { imbAttribute att = (imbAttribute) base[key]; return(att); } set { base[key] = value; } }
public imbAttributeToPropertyMap(Type __targetType) { PropertyInfo[] pi = new PropertyInfo[] { }; targetType = __targetType; pi = targetType.GetProperties(BindingFlags.Public | BindingFlags.Instance); foreach (PropertyInfo p in pi) { if (p.CanWrite) { imbAttributeCollection attributes = imbAttributeTools.getImbAttributeDictionary(p); if (attributes.ContainsKey(imbAttributeName.metaValueFromAttribute)) { imbAttribute att = attributes[imbAttributeName.metaValueFromAttribute]; Add(p, (imbAttributeName)att.objMsg); } } } }