コード例 #1
0
 TypeDefOrRefAndCAOptions CopyTo(TypeDefOrRefAndCAOptions options)
 {
     options.TypeDefOrRef = TypeSigCreator.TypeSig.ToTypeDefOrRef();
     options.CustomAttributes.Clear();
     options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
     return(options);
 }
コード例 #2
0
        public TypeDefOrRefAndCAVM(TypeDefOrRefAndCAOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod)
        {
            this.origOptions = options;

            var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, language)
            {
                IsLocal = false,
                CanAddGenericTypeVar   = true,
                CanAddGenericMethodVar = false,
                OwnerType   = ownerType,
                OwnerMethod = ownerMethod,
            };

            if (ownerType != null && ownerType.GenericParameters.Count == 0)
            {
                typeSigCreatorOptions.CanAddGenericTypeVar = false;
            }
            if (ownerMethod != null && ownerMethod.GenericParameters.Count > 0)
            {
                typeSigCreatorOptions.CanAddGenericMethodVar = true;
            }

            this.typeSigCreator             = new TypeSigCreatorVM(typeSigCreatorOptions);
            TypeSigCreator.PropertyChanged += TypeSigCreator_PropertyChanged;
            this.customAttributesVM         = new CustomAttributesVM(ownerModule, language);

            Reinitialize();
        }
コード例 #3
0
        public TypeDefOrRefAndCAVM(TypeDefOrRefAndCAOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef?ownerType, MethodDef?ownerMethod)
        {
            origOptions = options;

            var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, decompilerService)
            {
                IsLocal = false,
                CanAddGenericTypeVar   = true,
                CanAddGenericMethodVar = false,
                OwnerType   = ownerType,
                OwnerMethod = ownerMethod,
            };

            if (ownerType is not null && ownerType.GenericParameters.Count == 0)
            {
                typeSigCreatorOptions.CanAddGenericTypeVar = false;
            }
            if (ownerMethod is not null && ownerMethod.GenericParameters.Count > 0)
            {
                typeSigCreatorOptions.CanAddGenericMethodVar = true;
            }

            TypeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions);
            TypeSigCreator.PropertyChanged += TypeSigCreator_PropertyChanged;
            CustomAttributesVM              = new CustomAttributesVM(ownerModule, decompilerService);

            Reinitialize();
        }
コード例 #4
0
		public TypeDefOrRefAndCAVM(TypeDefOrRefAndCAOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType, MethodDef ownerMethod) {
			origOptions = options;

			var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, decompilerService) {
				IsLocal = false,
				CanAddGenericTypeVar = true,
				CanAddGenericMethodVar = false,
				OwnerType = ownerType,
				OwnerMethod = ownerMethod,
			};
			if (ownerType != null && ownerType.GenericParameters.Count == 0)
				typeSigCreatorOptions.CanAddGenericTypeVar = false;
			if (ownerMethod != null && ownerMethod.GenericParameters.Count > 0)
				typeSigCreatorOptions.CanAddGenericMethodVar = true;

			TypeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions);
			TypeSigCreator.PropertyChanged += TypeSigCreator_PropertyChanged;
			CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService);

			Reinitialize();
		}
コード例 #5
0
		public TypeDefOrRefAndCAVM(TypeDefOrRefAndCAOptions options, ModuleDef ownerModule, ILanguageManager languageManager, TypeDef ownerType, MethodDef ownerMethod) {
			this.origOptions = options;

			var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, languageManager) {
				IsLocal = false,
				CanAddGenericTypeVar = true,
				CanAddGenericMethodVar = false,
				OwnerType = ownerType,
				OwnerMethod = ownerMethod,
			};
			if (ownerType != null && ownerType.GenericParameters.Count == 0)
				typeSigCreatorOptions.CanAddGenericTypeVar = false;
			if (ownerMethod != null && ownerMethod.GenericParameters.Count > 0)
				typeSigCreatorOptions.CanAddGenericMethodVar = true;

			this.typeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions);
			TypeSigCreator.PropertyChanged += TypeSigCreator_PropertyChanged;
			this.customAttributesVM = new CustomAttributesVM(ownerModule, languageManager);

			Reinitialize();
		}
コード例 #6
0
 void InitializeFrom(TypeDefOrRefAndCAOptions options)
 {
     TypeSigCreator.TypeSig = options.TypeDefOrRef.ToTypeSig();
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }
コード例 #7
0
		TypeDefOrRefAndCAOptions CopyTo(TypeDefOrRefAndCAOptions options) {
			options.TypeDefOrRef = TypeSigCreator.TypeSig.ToTypeDefOrRef();
			options.CustomAttributes.Clear();
			options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
			return options;
		}
コード例 #8
0
		void InitializeFrom(TypeDefOrRefAndCAOptions options) {
			TypeSigCreator.TypeSig = options.TypeDefOrRef.ToTypeSig();
			CustomAttributesVM.InitializeFrom(options.CustomAttributes);
		}