コード例 #1
0
        public StoreLocalInfo(ICustomAttributeProvider param)
        {
            var attr = param.CustomAttributes.First(a => a.AttributeType.FullName == typeof(StoreLocal).FullName);

            Index = AttrHelper.GetConstructorAttribute <int>(attr, "Index", 0);
            Type  = AttrHelper.GetConstructorAttribute <TypeReference>(attr, "Type", 1);
        }
コード例 #2
0
ファイル: MixinInfo.cs プロジェクト: blay09/Sharpin
        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");
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: ImplementsInfo.cs プロジェクト: blay09/Sharpin
 public ImplementsInfo(TypeDefinition mixinContainer, CustomAttribute attr)
 {
     MixinContainer = mixinContainer;
     TargetType     = AttrHelper.GetConstructorAttribute <TypeReference>(attr, "TargetType");
 }
コード例 #5
0
        public CaptureFieldInfo(ICustomAttributeProvider field)
        {
            var attr = field.CustomAttributes.First(a => a.AttributeType.FullName == typeof(CaptureField).FullName);

            Field = AttrHelper.GetConstructorAttribute <string>(attr, "Field");
        }