protected override void OnCreate(ExtensionArgs args)
        {
            base.OnCreate(args);
            ClassExtensionScanner scanner = new ClassExtensionScanner(GetType());

            scanner.Scan(ClassExtensionScanner.ScanOption.Informations);
            var infos = scanner.Informations;

            _cn = infos[DpmReceiverAttribute.KEY].Value as string;
        }
Пример #2
0
 /// <summary>
 /// 构造
 /// </summary>
 public ClassExtensionBase()
 {
     var scanner = new ClassExtensionScanner(GetType());
     scanner.Scan(ClassExtensionScanner.ScanOption.BeforeCreatingAspect);
     var bcAspects = scanner.BeforeCreatingAspects;
     bool canContinue = true;
     BeforeCreatingAspectArgs bcaArgs = new BeforeCreatingAspectArgs(this, GetType());
     foreach (var aspect in bcAspects)
     {
         aspect.BeforeCreating(bcaArgs, ref canContinue);
         if (!canContinue)
         {
             throw new AspectPreventedException();
         }
     }
 }