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;
		}