IsCreateable() public static method

public static IsCreateable ( Type type ) : bool
type Type
return bool
示例#1
0
        public static void RegisterCreateableType(string scriptAlias, Type type)
        {
#if !ANDROID_HACK
            CheckThread();
            // no call to CheckHtmlAccess(); -- see DRT365
            CheckName(scriptAlias, "scriptAlias");
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (!ManagedObject.IsCreateable(type))
            {
                throw new ArgumentException(type.ToString(), "type");
            }

            if (HostServices.Current.CreateableTypes.ContainsKey(scriptAlias))
            {
                throw new ArgumentException("scriptAlias");
            }

            HostServices.Current.CreateableTypes [scriptAlias] = type;
#endif
        }