/// <param name="type">Type of element.</param> /// <param name="attr">Found attribute.</param> /// <param name="data"></param> protected void InspectLevelA(Type type, Attribute attr, LInfo data) { if (!IsComponent(type) || (attr.GetType() != typeof(DefinitionAttribute) && attr.GetType() != typeof(ComponentAttribute))) { return; } IAttrDomLevelA levA = (IAttrDomLevelA)attr; NodeIdent ident = new NodeIdent(levA.Parent, null); if (!data.ContainsKey(ident)) { data[ident] = new List <INodeInfo>(); } if (attr.GetType() == typeof(DefinitionAttribute)) { data[ident].Add(new NodeInfo((DefinitionAttribute)attr)); return; } if (attr.GetType() == typeof(ComponentAttribute)) { INodeInfo node = new NodeInfo((ComponentAttribute)attr); data[ident].Add(node); AliasesToNodeLevelA(node, data[ident]); return; } }
/// <param name="type">Type of element.</param> /// <param name="attr">Found attribute.</param> /// <param name="method">Found method.</param> /// <param name="data"></param> protected void InspectLevelB(Type type, Attribute attr, MethodInfo method, LInfo data) { if (!IsComponent(type) || (attr.GetType() != typeof(MethodAttribute) && attr.GetType() != typeof(PropertyAttribute))) { return; } IAttrDomLevelB levB = (IAttrDomLevelB)attr; string className = method.DeclaringType.FullName; NodeIdent ident = new NodeIdent(levB.Parent ?? GetComponentName(type), levB.Method, (levB.Method == null)? null : className); if (!data.ContainsKey(ident)) { data[ident] = new List <INodeInfo>(); } className = (method.Name == null)? null : className; if (attr.GetType() == typeof(PropertyAttribute)) { data[ident].Add(new NodeInfo((PropertyAttribute)attr, method.Name, className)); return; } if (attr.GetType() == typeof(MethodAttribute)) { data[ident].Add(new NodeInfo((MethodAttribute)attr, method.Name, className)); return; } }
/// <summary> /// List of constructed data by identification of node. /// </summary> /// <param name="ident">Identifier of node.</param> /// <returns></returns> public IEnumerable <INodeInfo> GetBy(NodeIdent ident = new NodeIdent()) { if (data.ContainsKey(ident)) { foreach (INodeInfo elem in data[ident].OrderBy(p => p.Name)) { if (IsEnabled(elem.Name)) { yield return(elem); } } } }