コード例 #1
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();
        }
コード例 #2
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);
 }
コード例 #3
0
ファイル: TypeDefOrRefAndCAVM.cs プロジェクト: damnya/dnSpy
        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();
        }
コード例 #4
0
ファイル: TypeDefOrRefAndCAVM.cs プロジェクト: damnya/dnSpy
 void InitializeFrom(TypeDefOrRefAndCAOptions options)
 {
     TypeSigCreator.TypeSig = options.TypeDefOrRef.ToTypeSig();
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }
コード例 #5
0
ファイル: TypeDefOrRefAndCAVM.cs プロジェクト: damnya/dnSpy
 TypeDefOrRefAndCAOptions CopyTo(TypeDefOrRefAndCAOptions options)
 {
     options.TypeDefOrRef = TypeSigCreator.TypeSig.ToTypeDefOrRef();
     options.CustomAttributes.Clear();
     options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
     return options;
 }
コード例 #6
0
 void InitializeFrom(TypeDefOrRefAndCAOptions options)
 {
     TypeSigCreator.TypeSig = options.TypeDefOrRef.ToTypeSig();
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }