CreateTemplatedClone() public method

If the PluginType is an open generic type, this method will create a closed type copy of this PluginFamily
public CreateTemplatedClone ( Type templateTypes ) : PluginFamily
templateTypes System.Type
return PluginFamily
コード例 #1
0
        public PluginFamily CreateTemplatedFamily(Type templatedType, ProfileManager profileManager)
        {
            Type basicType = templatedType.GetGenericTypeDefinition();

            if (_families.Has(basicType))
            {
                PluginFamily basicFamily             = _families[basicType];
                Type[]       templatedParameterTypes = templatedType.GetGenericArguments();


                PluginFamily templatedFamily = basicFamily.CreateTemplatedClone(templatedParameterTypes);
                PluginFamily family          = templatedFamily;
                profileManager.CopyDefaults(basicType, templatedType, family);

                return(family);
            }
            else
            {
                return(null);
            }
        }