Exemplo n.º 1
0
 public CliMetadatum(ICliMetadataCustomAttributeTableRow metadataEntry, _ICliAssembly owner)
 {
     this.declarationPoint = owner;
     this.metadataEntry    = metadataEntry;
     this.identityManager  = owner.IdentityManager;
     this.parameters       = new Lazy <IEnumerable <MetadatumTypedParameter> >(() => this.GetParameters().SinglePass(), true);
     this.namedParameters  = new Lazy <IEnumerable <MetadatumNamedParameter> >(() => this.GetNamedParameters().SinglePass(), true);;
 }
Exemplo n.º 2
0
 private IMetadatum CreateMetadatum(ICliMetadataCustomAttributeTableRow metadataEntry)
 {
     if (this.declarationPoint is _ICliAssembly)
     {
         return(new CliMetadatum(metadataEntry, (_ICliAssembly)(this.declarationPoint)));
     }
     else
     {
         return(new CliMetadatum(metadataEntry, this.identityManager, this.declarationPoint));
     }
 }
        public ICliMetadataCustomAttribute _GetCustomAttribute(_ICliManager identityManager, ICliMetadataCustomAttributeTableRow target)
        {
            uint heapIndex = target.ValueIndex;

            if (heapIndex >= this.Size)
            {
                throw new ArgumentOutOfRangeException("heapIndex");
            }
            SmallBlobEntry  smallResult;
            MediumBlobEntry mediumResult;
            LargeBlobEntry  largeResult;

            lock (this.syncObject)
            {
                if (smallEntries.TryGetValue(heapIndex, out smallResult))
                {
                    if (smallResult.Signature == null)
                    {
                        GetCustomAttribute(identityManager, target, smallResult);
                    }
                    return((ICliMetadataCustomAttribute)smallResult.Signature);
                }
                else if (mediumEntries.TryGetValue(heapIndex, out mediumResult))
                {
                    if (mediumResult.Signature == null)
                    {
                        GetCustomAttribute(identityManager, target, mediumResult);
                    }
                    return((ICliMetadataCustomAttribute)mediumResult.Signature);
                }
                else if (!largEntries.TryGetValue(heapIndex, out largeResult))
                {
                    throw new IndexOutOfRangeException("heapIndex");
                }
                else
                {
                    if (largeResult.Signature == null)
                    {
                        GetCustomAttribute(identityManager, target, largeResult);
                    }
                    return((ICliMetadataCustomAttribute)largeResult.Signature);
                }
            }
            throw new ArgumentOutOfRangeException("heapIndex");
        }
 public ICliMetadataCustomAttribute GetCustomAttribute(ICliManager identityManager, ICliMetadataCustomAttributeTableRow target)
 {
     if (identityManager is _ICliManager)
     {
         return(_GetCustomAttribute((_ICliManager)identityManager, target));
     }
     throw new ArgumentException(string.Format("identityManager must implement {0}", typeof(_ICliManager).FullName));
 }
        private ICliMetadataCustomAttribute GetCustomAttribute(_ICliManager identityManager, ICliMetadataCustomAttributeTableRow target, _ICliMetadataBlobEntry entry)
        {
            uint offset = target.ValueIndex + entry.LengthByteCount;

            this.reader.BaseStream.Seek(offset, SeekOrigin.Begin);
            return((ICliMetadataCustomAttribute)(entry.Signature = SignatureParser.ParseCustomAttribute(reader, metadataRoot, identityManager, target, (uint)entry.Length)));
        }
Exemplo n.º 6
0
 public void Dispose()
 {
     this.metadataEntry    = null;
     this.declarationPoint = null;
 }