protected virtual TConverterBase CreateInstance() { if (ConverterType == typeof(EnumConverter) && TargetType.UnderlyingType != null && TargetType.UnderlyingType.IsEnum) { return((TConverterBase)(object)new EnumConverter(TargetType.UnderlyingType)); } else if (ConverterType != null) { if (!typeof(TConverterBase).IsAssignableFrom(ConverterType)) { throw new XamlSchemaException(SR.Get(SRID.ConverterMustDeriveFromBase, ConverterType, typeof(TConverterBase))); } return((TConverterBase)SafeReflectionInvoker.CreateInstance(ConverterType, null)); } return(null); }
private object CreateInstanceWithActivator(Type type, object[] arguments) { return(SafeReflectionInvoker.CreateInstance(type, arguments)); }