Mono.Addins.ExtensionTree.GetMembersMap C# (CSharp) Méthode

GetMembersMap() private méthode

private GetMembersMap ( Type type, Mono.Addins.Description.ExtensionNodeType &boundAttributeType ) : ExtensionNodeType.FieldData>.Dictionary
type System.Type
boundAttributeType Mono.Addins.Description.ExtensionNodeType
Résultat ExtensionNodeType.FieldData>.Dictionary
        Dictionary<string, ExtensionNodeType.FieldData> GetMembersMap(Type type, out ExtensionNodeType.FieldData boundAttributeType)
        {
            string fname;
            Dictionary<string,ExtensionNodeType.FieldData> fields = new Dictionary<string, ExtensionNodeType.FieldData> ();
            boundAttributeType = null;

            while (type != typeof(object) && type != null) {
                foreach (FieldInfo field in type.GetFields (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) {
                    NodeAttributeAttribute at = (NodeAttributeAttribute) Attribute.GetCustomAttribute (field, typeof(NodeAttributeAttribute), true);
                    if (at != null) {
                        ExtensionNodeType.FieldData fd = CreateFieldData (field, at, out fname, ref boundAttributeType);
                        if (fd != null)
                            fields [fname] = fd;
                    }
                }
                foreach (PropertyInfo prop in type.GetProperties (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) {
                    NodeAttributeAttribute at = (NodeAttributeAttribute) Attribute.GetCustomAttribute (prop, typeof(NodeAttributeAttribute), true);
                    if (at != null) {
                        ExtensionNodeType.FieldData fd = CreateFieldData (prop, at, out fname, ref boundAttributeType);
                        if (fd != null)
                            fields [fname] = fd;
                    }
                }
                type = type.BaseType;
            }
            return fields;
        }