private Boxed CreateValue() { try { return(valueFactory != null ? new Boxed(valueFactory()) : new Boxed(default(T))); } catch (Exception ex) { boxed = new UnLazyInternalExceptionHolder(ex); throw; } }
private T LazyInitValue() { Boxed boxed = null; lock (syncRoot) { if (this.boxed == null) { boxed = CreateValue(); this.boxed = boxed; } else { boxed = this.boxed as Boxed; if (boxed == null) { UnLazyInternalExceptionHolder holder = this.boxed as UnLazyInternalExceptionHolder; holder.edi.Throw(); } } } return(boxed.value); }