public static void VerifyType(Type targetType) { if (targetType.GetIsInterface() || targetType.GetIsAbstract()) { throw SerializationExceptions.NewNotSupportedBecauseCannotInstanciateAbstractType(targetType); } }
private Type EnsureConcreteTypeRegistered( Type mayBeAbstractType ) { if ( !mayBeAbstractType.GetIsAbstract() && !mayBeAbstractType.GetIsInterface() ) { return mayBeAbstractType; } var concreteType = this.DefaultCollectionTypes.GetConcreteType( mayBeAbstractType ); if ( concreteType == null ) { throw SerializationExceptions.NewNotSupportedBecauseCannotInstanciateAbstractType( mayBeAbstractType ); } return concreteType; }