public virtual void Visit(CustomAttributeCtorArgumentCollection arguments)
 {
     for (int i = 0; i < arguments.Count; i++)
     {
         Visit(arguments[i]);
     }
 }
예제 #2
0
 public void CopyTo(CustomAttributeCtorArgumentCollection copy)
 {
     foreach (var item in this)
     {
         copy.Add(item);
     }
 }
예제 #3
0
 public virtual void Build(CustomAttributeCtorArgumentCollection arguments)
 {
     for (int i = 0; i < arguments.Count; i++)
     {
         var argument = arguments[i];
         if (Build(ref argument))
         {
             arguments[i] = argument;
         }
     }
 }
        protected void Load(IBinaryAccessor accessor)
        {
            // The encoded blob begins with the prolog, which is always the 2-byte value 0x0001.
            // This is actually the version of the custom attribute blob encoding scheme, which hasn't changed
            // since its introduction, so the prolog is the same for all existing versions of the runtime.
            short prolog = accessor.ReadInt16();

            if (prolog != 1)
            {
                throw new CodeModelException(string.Format(SR.AssemblyLoadError, _module.Location));
            }

            // Ctor arguments.
            _ctorArguments = new CustomAttributeCtorArgumentCollection(this);
            _ctorArguments.Load(accessor);

            // Named arguments.
            _namedArguments = new CustomAttributeNamedArgumentCollection(this);
            _namedArguments.Load(accessor);
        }