Example #1
0
        public SecurityAttributeVM(SecurityAttribute sa, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod)
        {
            this.origSa             = sa;
            this.ownerModule        = ownerModule;
            this.caNamedArgumentsVM = new CANamedArgumentsVM(ownerModule, language, ownerType, ownerMethod, a => {
                // The named args blob length must also be at most 0x1FFFFFFF bytes but we can't verify it here
                return(a.Collection.Count < ModelUtils.COMPRESSED_UINT32_MAX);
            });
            CANamedArgumentsVM.Collection.CollectionChanged += Args_CollectionChanged;

            Reinitialize();
        }
Example #2
0
        public CustomAttributeVM(CustomAttributeOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod)
        {
            this.origOptions = options;
            this.ownerModule = ownerModule;
            this.language    = language;
            this.ownerType   = ownerType;
            this.ownerMethod = ownerMethod;

            this.rawData            = new HexStringVM(a => HasErrorUpdated());
            this.caNamedArgumentsVM = new CANamedArgumentsVM(ownerModule, language, ownerType, ownerMethod, a => !IsRawData && a.Collection.Count < ushort.MaxValue);
            ConstructorArguments.CollectionChanged          += Args_CollectionChanged;
            CANamedArgumentsVM.Collection.CollectionChanged += Args_CollectionChanged;

            Reinitialize();
        }