示例#1
0
 public GenericParamConstraint CopyTo(GenericParamConstraint gpc)
 {
     gpc.Constraint = this.TypeDefOrRef;
     gpc.CustomAttributes.Clear();
     gpc.CustomAttributes.AddRange(CustomAttributes);
     return(gpc);
 }
示例#2
0
        GenericParamConstraintUser Clone(GenericParamConstraint source)
        {
            var result = new GenericParamConstraintUser(Importer.Import(source.Constraint));

            CopyCustomAttributes(source, result);
            CopyCustomDebugInfo(source, result);
            return(result);
        }
示例#3
0
 void Add(GenericParamConstraint gpc)
 {
     if (gpc == null)
     {
         return;
     }
     Add(gpc.Owner);
     Push(gpc.Constraint);
     Add(gpc.CustomAttributes);
 }
示例#4
0
 internal void WriteGenericParamConstraint(GenericParamConstraint paramConstraint)
 {
     if (paramConstraint.UpdateRowOnRebuild)
     {
         object[] parts = new object[]
         {
             GetMemberIndex(paramConstraint.Owner),
             GetCodedIndex(tablesHeap.TypeDefOrRef, paramConstraint.Constraint),
         };
         paramConstraint.MetaDataRow = new MetaDataRow(parts);
     }
     writer.Write(paramConstraint.MetaDataRow.GenerateBytes());
 }
示例#5
0
 internal void CalcElemSize()
 {
     elemSize[(int)MDTable.Assembly]             = Assembly.Size(this);
     elemSize[(int)MDTable.AssemblyOS]           = 12;
     elemSize[(int)MDTable.AssemblyProcessor]    = 4;
     elemSize[(int)MDTable.AssemblyRefOS]        = 12 + TableIndexSize(MDTable.AssemblyRef);
     elemSize[(int)MDTable.AssemblyRefProcessor] = 4 + TableIndexSize(MDTable.AssemblyRef);
     elemSize[(int)MDTable.Module]                 = Module.Size(this);
     elemSize[(int)MDTable.TypeRef]                = ClassRef.Size(this);
     elemSize[(int)MDTable.TypeDef]                = ClassDef.Size(this);
     elemSize[(int)MDTable.Field]                  = FieldDef.Size(this);
     elemSize[(int)MDTable.Method]                 = MethodDef.Size(this);
     elemSize[(int)MDTable.Param]                  = Param.Size(this);
     elemSize[(int)MDTable.InterfaceImpl]          = InterfaceImpl.Size(this);
     elemSize[(int)MDTable.MemberRef]              = FieldRef.Size(this);
     elemSize[(int)MDTable.Constant]               = ConstantElem.Size(this);
     elemSize[(int)MDTable.CustomAttribute]        = CustomAttribute.Size(this);
     elemSize[(int)MDTable.FieldMarshal]           = FieldMarshal.Size(this);
     elemSize[(int)MDTable.DeclSecurity]           = DeclSecurity.Size(this);
     elemSize[(int)MDTable.ClassLayout]            = ClassLayout.Size(this);
     elemSize[(int)MDTable.FieldLayout]            = FieldLayout.Size(this);
     elemSize[(int)MDTable.StandAloneSig]          = Signature.Size(this);
     elemSize[(int)MDTable.EventMap]               = MapElem.Size(this, MDTable.EventMap);
     elemSize[(int)MDTable.Event]                  = Event.Size(this);
     elemSize[(int)MDTable.PropertyMap]            = MapElem.Size(this, MDTable.PropertyMap);
     elemSize[(int)MDTable.Property]               = Property.Size(this);
     elemSize[(int)MDTable.MethodSemantics]        = MethodSemantics.Size(this);
     elemSize[(int)MDTable.MethodImpl]             = MethodImpl.Size(this);
     elemSize[(int)MDTable.ModuleRef]              = ModuleRef.Size(this);
     elemSize[(int)MDTable.TypeSpec]               = TypeSpec.Size(this);
     elemSize[(int)MDTable.ImplMap]                = ImplMap.Size(this);
     elemSize[(int)MDTable.FieldRVA]               = FieldRVA.Size(this);
     elemSize[(int)MDTable.Assembly]               = Assembly.Size(this);
     elemSize[(int)MDTable.AssemblyRef]            = AssemblyRef.Size(this);
     elemSize[(int)MDTable.File]                   = FileRef.Size(this);
     elemSize[(int)MDTable.ExportedType]           = ExternClass.Size(this);
     elemSize[(int)MDTable.ManifestResource]       = ManifestResource.Size(this);
     elemSize[(int)MDTable.NestedClass]            = MapElem.Size(this, MDTable.NestedClass);
     elemSize[(int)MDTable.GenericParam]           = GenericParam.Size(this);
     elemSize[(int)MDTable.GenericParamConstraint] = GenericParamConstraint.Size(this);
     elemSize[(int)MDTable.MethodSpec]             = MethodSpec.Size(this);
 }
示例#6
0
 GenericParamConstraint Clone(GenericParamConstraint gpc) =>
 new GenericParamConstraintUser((ITypeDefOrRef)generatedModule.Import(gpc.Constraint));
示例#7
0
 public TypeDefOrRefAndCAOptions(GenericParamConstraint gpc)
 {
     this.TypeDefOrRef = gpc.Constraint;
     this.CustomAttributes.AddRange(gpc.CustomAttributes);
 }
 GenericParamConstraint Clone(GenericParamConstraint gpc) =>
 public int GetHashCode(GenericParamConstraint obj) => 0;
 public bool Equals(GenericParamConstraint x, GenericParamConstraint y) => ReferenceEquals(x, y) || !(x is null) && !(y is null) && typeComparer.Equals(x.Constraint, y.Constraint);
示例#11
0
 /// <summary>
 /// Clones the specified generic parameter constraint.
 /// </summary>
 /// <param name="genericParamConstraint">The generic parameter constraint.</param>
 /// <returns></returns>
 public static GenericParamConstraint Clone(this GenericParamConstraint genericParamConstraint)
 {
     return(new GenericParamConstraintUser(genericParamConstraint.Constraint));
 }