MethodSpecOptions CopyTo(MethodSpecOptions options) { options.Method = this.Method; options.Instantiation = new GenericInstMethodSig(CreateTypeSigArrayVM.TypeSigCollection); options.CustomAttributes.Clear(); options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create())); return(options); }
void InitializeFrom(MethodSpecOptions options) { this.Method = options.Method; var gim = options.Instantiation as GenericInstMethodSig; CreateTypeSigArrayVM.TypeSigCollection.Clear(); if (gim != null) { CreateTypeSigArrayVM.TypeSigCollection.AddRange(gim.GenericArguments); } this.CustomAttributesVM.InitializeFrom(options.CustomAttributes); }
public MethodSpecVM(MethodSpecOptions options, TypeSigCreatorOptions typeSigCreatorOptions) { this.origOptions = options; this.typeSigCreatorOptions = typeSigCreatorOptions; this.customAttributesVM = new CustomAttributesVM(typeSigCreatorOptions.OwnerModule, typeSigCreatorOptions.Language); this.typeSigCreatorOptions.CanAddGenericMethodVar = true; this.typeSigCreatorOptions.CanAddGenericTypeVar = true; this.typeSigCreatorOptions.IsLocal = false; this.typeSigCreatorOptions.NullTypeSigAllowed = false; this.createTypeSigArrayVM = new CreateTypeSigArrayVM(typeSigCreatorOptions, null); Reinitialize(); }
void InitializeFrom(MethodSpecOptions options) { this.Method = options.Method; var gim = options.Instantiation as GenericInstMethodSig; CreateTypeSigArrayVM.TypeSigCollection.Clear(); if (gim != null) CreateTypeSigArrayVM.TypeSigCollection.AddRange(gim.GenericArguments); this.CustomAttributesVM.InitializeFrom(options.CustomAttributes); }
MethodSpecOptions CopyTo(MethodSpecOptions options) { options.Method = this.Method; options.Instantiation = new GenericInstMethodSig(CreateTypeSigArrayVM.TypeSigCollection); options.CustomAttributes.Clear(); options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create())); return options; }