NewNotSupportedBecauseCannotInstanciateAbstractType() публичный статический Метод

This is intended to MsgPack for CLI internal use. Do not use this type from application directly. Returns new exception to notify that operation is not supported because type cannot be instanciated.
public static NewNotSupportedBecauseCannotInstanciateAbstractType ( Type type ) : Exception
type System.Type Type.
Результат System.Exception
Пример #1
0
 public static void VerifyType(Type targetType)
 {
     if (targetType.GetIsInterface() || targetType.GetIsAbstract())
     {
         throw SerializationExceptions.NewNotSupportedBecauseCannotInstanciateAbstractType(targetType);
     }
 }
Пример #2
0
		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;
		}