Example #1
0
        public MixinInfo(TypeDefinition mixinContainer)
        {
            MixinContainer = mixinContainer;
            var attr = mixinContainer.CustomAttributes.First(a => a.AttributeType.FullName == typeof(Mixin).FullName);

            TargetType = AttrHelper.GetConstructorAttribute <TypeReference>(attr, "TargetType");
            Target     = AttrHelper.GetAttribute <string>(attr, "target");
            Priority   = AttrHelper.GetAttribute <int>(attr, "priority");
        }
Example #2
0
        public InjectInfo(MethodDefinition newMethod)
        {
            NewMethod = newMethod;
            var attr = newMethod.CustomAttributes.First(a => a.AttributeType.FullName == typeof(Inject).FullName);

            Method             = AttrHelper.GetAttribute <string>(attr, "Method");
            At                 = AttrHelper.GetAttribute <string>(attr, "At");
            Cancellable        = AttrHelper.GetAttribute <bool>(attr, "Cancellable");
            CancelTarget       = AttrHelper.GetAttribute(attr, "CancelTarget", "ret");
            ExpectedInjections = AttrHelper.GetAttribute(attr, "ExpectedInjections", 1);
        }