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); } }
public PropertyValueHolder(TInstance instance, ExceptionDispatchInfo exception) { if (instance is null) { throw new ArgumentNullException(paramName: nameof(instance)); } // _holder = new ValueHolderStruct <T>(exception: exception); _instance = instance; }
public PropertyValueHolder(TInstance instance, T value) { if (instance is null) { throw new ArgumentNullException(paramName: nameof(instance)); } // _holder = new ValueHolderStruct <T>(value: value); _instance = instance; }
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); } } }