private static void InitFields( ref CILElementKind cilKind, ref LazyWithLock <ListProxy <CILCustomAttribute> > attributesField, CILElementKind kind, LazyWithLock <ListProxy <CILCustomAttribute> > attributes ) { cilKind = kind; attributesField = attributes; }
internal CILCustomAttributeContainerImpl( CILReflectionContextImpl ctx, CILElementKind kind, Int32 anID, LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc ) : base(ctx, anID) { InitFields( ref this.cilKind, ref this.attributes, kind, cAttrDataFunc ); }
internal CILCustomAttributeContainerImpl( CILReflectionContextImpl ctx, Int32 anID, CILElementKind kind, Func <CustomAttributeDataEventArgs> evtArgsFunc ) : base(ctx, anID) { ArgumentValidator.ValidateNotNull("Reflection context", ctx); InitFields( ref this.cilKind, ref this.attributes, kind, new LazyWithLock <ListProxy <CILCustomAttribute> >(() => { var evtArgs = evtArgsFunc(); ctx.LaunchCustomAttributeDataLoadEvent(evtArgs); var thisElement = (CILCustomAttributeContainer)this.context.Cache.ResolveAnyID(this.cilKind, this.id); return(ctx.CollectionsFactory.NewListProxy <CILCustomAttribute>(new List <CILCustomAttribute>(evtArgs.CustomAttributeData.Select(tuple => CILCustomAttributeFactory.NewAttribute(thisElement, tuple.Item1, tuple.Item2, tuple.Item3))))); }) ); }