void InitializeFrom(MemberRefOptions options) { this.Class = options.Class; this.Name = options.Name; if (IsField) { var fs = options.Signature as FieldSig; TypeSigCreatorVM.TypeSig = fs == null ? null : fs.Type; } else { MethodSigCreatorVM.MethodSig = options.Signature as MethodSig; } CustomAttributesVM.InitializeFrom(options.CustomAttributes); }
MemberRefOptions CopyTo(MemberRefOptions options) { options.Class = this.Class; options.Name = this.Name; if (IsField) { options.Signature = new FieldSig(TypeSigCreatorVM.TypeSig); } else { options.Signature = MethodSigCreatorVM.MethodSig; } options.CustomAttributes.Clear(); options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create())); return(options); }
public MemberRefVM(MemberRefOptions options, TypeSigCreatorOptions typeSigCreatorOptions, bool isField) { this.isField = isField; this.typeSigCreatorOptions = typeSigCreatorOptions.Clone(); this.origOptions = options; 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.typeSigCreatorVM = new TypeSigCreatorVM(this.typeSigCreatorOptions.Clone("Create Field TypeSig")); TypeSigCreatorVM.PropertyChanged += (s, e) => HasErrorUpdated(); var mopts = new MethodSigCreatorOptions(this.typeSigCreatorOptions.Clone()); mopts.CanHaveSentinel = true; this.methodSigCreatorVM = new MethodSigCreatorVM(mopts); MethodSigCreatorVM.PropertyChanged += (s, e) => HasErrorUpdated(); Reinitialize(); }
void InitializeFrom(MemberRefOptions options) { this.Class = options.Class; this.Name = options.Name; if (IsField) { var fs = options.Signature as FieldSig; TypeSigCreatorVM.TypeSig = fs == null ? null : fs.Type; } else MethodSigCreatorVM.MethodSig = options.Signature as MethodSig; CustomAttributesVM.InitializeFrom(options.CustomAttributes); }
MemberRefOptions CopyTo(MemberRefOptions options) { options.Class = this.Class; options.Name = this.Name; if (IsField) options.Signature = new FieldSig(TypeSigCreatorVM.TypeSig); else options.Signature = MethodSigCreatorVM.MethodSig; options.CustomAttributes.Clear(); options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create())); return options; }