Ejemplo n.º 1
0
 static P_ConvertAsReadOnly()
 {
     try {
         __Ctor = new ValueHolderStruct <Func <T, bool, TResult> >(value: ActivationUtilities.RequireConstructor <T, bool, TResult>());
     }
     catch (Exception exception) {
         __Ctor = new ValueHolderStruct <Func <T, bool, TResult> >(exception: exception);
     }
 }
Ejemplo n.º 2
0
 public PropertyValueHolder(TInstance instance, ExceptionDispatchInfo exception)
 {
     if (instance is null)
     {
         throw new ArgumentNullException(paramName: nameof(instance));
     }
     //
     _holder   = new ValueHolderStruct <T>(exception: exception);
     _instance = instance;
 }
Ejemplo n.º 3
0
 public PropertyValueHolder(TInstance instance, T value)
 {
     if (instance is null)
     {
         throw new ArgumentNullException(paramName: nameof(instance));
     }
     //
     _holder   = new ValueHolderStruct <T>(value: value);
     _instance = instance;
 }
Ejemplo n.º 4
0
 public static void Dispose <T>(this ValueHolderStruct <T> holder, Exception exception = default)
     where T : IDisposable
 {
     try {
         holder.ValueExceptionTolerant?.Dispose();
     }
     catch (Exception secondException) {
         if (exception is null)
         {
             throw;
         }
         else
         {
             throw new AggregateException(exception, secondException);
         }
     }
 }