private static void LoadNodeTypes(SnapInRegistrationInfo info, Type type)
{
ExtendsNodeTypeAttribute[] customAttributes = (ExtendsNodeTypeAttribute[]) type.GetCustomAttributes(typeof(ExtendsNodeTypeAttribute), true);
PublishesNodeTypeAttribute[] attributeArray2 = (PublishesNodeTypeAttribute[]) type.GetCustomAttributes(typeof(PublishesNodeTypeAttribute), true);
if (((customAttributes.Length > 0) && !type.IsSubclassOf(typeof(NamespaceExtension))) && !type.IsSubclassOf(typeof(PropertySheetExtension)))
{
throw new Exception(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.SnapInRegistrationLoadNodeTypesWrongType));
}
foreach (PublishesNodeTypeAttribute attribute in attributeArray2)
{
NodeType item = new NodeType();
item.Description = attribute.Description;
item.Guid = attribute.Guid;
info.NodeTypes.Add(item);
}
foreach (ExtendsNodeTypeAttribute attribute2 in customAttributes)
{
info.ExtendedNodeTypes.Add(attribute2.NodeType);
}
}
}