示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
        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();
        }
示例#4
0
        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();
        }
示例#5
0
 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);
 }
示例#6
0
 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;
 }