コード例 #1
0
ファイル: AuditProccesors.cs プロジェクト: aries544/eXpand
 public override bool IsSuitableAuditProcessor(ObjectAuditProcessor processor, ObjectAuditingMode mode) {
     var isNoAuditMode = mode == (ObjectAuditingMode)Logic.ObjectAuditingMode.None;
     if (isNoAuditMode) {
         return processor is NoAuditProccesor;
     }
     return base.IsSuitableAuditProcessor(processor, mode);
 }
コード例 #2
0
ファイル: AuditProccesors.cs プロジェクト: aries544/eXpand
 public override ObjectAuditProcessor CreateAuditProcessor(ObjectAuditingMode mode, Session session, AuditTrailSettings settings) {
     var auditTrailSettings = new AuditTrailSettings();
     auditTrailSettings.SetXPDictionary(XpandModuleBase.Dictiorary);
     foreach (var auditTrailClassInfo in settings.TypesToAudit) {
         var auditTrailMemberInfos = auditTrailClassInfo.Properties;
         auditTrailSettings.AddType(auditTrailClassInfo.ClassInfo.ClassType, auditTrailMemberInfos.Select(info => info.Name).ToArray());
     }
     return mode == (ObjectAuditingMode)Logic.ObjectAuditingMode.None ? new NoAuditProccesor(session, auditTrailSettings) : base.CreateAuditProcessor(mode, session, auditTrailSettings);
 }
コード例 #3
0
        public override ObjectAuditProcessor CreateAuditProcessor(ObjectAuditingMode mode, Session session, AuditTrailSettings settings)
        {
            var auditTrailSettings = new AuditTrailSettings();

            auditTrailSettings.SetXPDictionary(XpandModuleBase.Dictiorary);
            foreach (var auditTrailClassInfo in settings.TypesToAudit)
            {
                var auditTrailMemberInfos = auditTrailClassInfo.Properties;
                auditTrailSettings.AddType(auditTrailClassInfo.ClassInfo.ClassType, auditTrailMemberInfos.Select(info => info.Name).ToArray());
            }
            return(mode == (ObjectAuditingMode)Logic.ObjectAuditingMode.None ? new NoAuditProccesor(session, auditTrailSettings) : base.CreateAuditProcessor(mode, session, auditTrailSettings));
        }
コード例 #4
0
ファイル: AuditProccesors.cs プロジェクト: xyyhqq/eXpand
        public override ObjectAuditProcessor CreateAuditProcessor(ObjectAuditingMode mode, Session session, AuditTrailSettings settings)
        {
            var auditTrailSettings = new AuditTrailSettings();

            auditTrailSettings.SetXPDictionary(XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary);
            foreach (var auditTrailClassInfo in settings.TypesToAudit)
            {
                var auditTrailMemberInfos = auditTrailClassInfo.Properties;
                if (!(auditTrailClassInfo.ClassInfo is IntermediateClassInfo))
                {
                    auditTrailSettings.AddType(auditTrailClassInfo.ClassInfo.ClassType, auditTrailMemberInfos.Select(info => info.Name).ToArray());
                }
            }
            return(mode == (ObjectAuditingMode)Persistent.Base.AuditTrail.ObjectAuditingMode.None ? new NoAuditProccesor(session, auditTrailSettings) : base.CreateAuditProcessor(mode, session, auditTrailSettings));
        }
コード例 #5
0
 void ApplyCustomization(IAuditTrailRule auditTrailRule) {
     var auditTrailService = AuditTrailService.Instance;
     if (auditTrailRule.AuditingMode.HasValue) {
         _oldObjectAuditingMode = auditTrailService.ObjectAuditingMode;
         auditTrailService.ObjectAuditingMode = auditTrailRule.AuditingMode.Value;
     }
     var auditTrailSettings = auditTrailService.Settings;
     _oldTypesToAudit = auditTrailSettings.TypesToAudit;
     
     var memberNames = GetMembers((AuditTrailRule) auditTrailRule);
     if (memberNames.Any()) {
         auditTrailSettings.Clear();
         var names = memberNames.Select(info => info.Name).ToArray();
         auditTrailSettings.AddType(auditTrailRule.TypeInfo.Type, auditTrailRule.IncludeRelatedTypes, names);
     }
 }
コード例 #6
0
        void ApplyCustomization(IAuditTrailRule auditTrailRule)
        {
            var auditTrailService = AuditTrailService.Instance;

            if (auditTrailRule.AuditingMode.HasValue)
            {
                _oldObjectAuditingMode = auditTrailService.ObjectAuditingMode;
                auditTrailService.ObjectAuditingMode = auditTrailRule.AuditingMode.Value;
            }
            var auditTrailSettings = auditTrailService.Settings;

            _oldTypesToAudit = auditTrailSettings.TypesToAudit;

            var memberNames = GetMembers((AuditTrailRule)auditTrailRule);

            if (memberNames.Any())
            {
                auditTrailSettings.Clear();
                var names = memberNames.Select(info => info.Name).ToArray();
                auditTrailSettings.AddType(auditTrailRule.TypeInfo.Type, auditTrailRule.IncludeRelatedTypes, names);
            }
        }
コード例 #7
0
        public override bool IsSuitableAuditProcessor(ObjectAuditProcessor processor, ObjectAuditingMode mode)
        {
            var isNoAuditMode = mode == (ObjectAuditingMode)Logic.ObjectAuditingMode.None;

            if (isNoAuditMode)
            {
                return(processor is NoAuditProccesor);
            }
            return(base.IsSuitableAuditProcessor(processor, mode));
        }
        private void BeginSessionAudit(Session session)
        {
            ObjectAuditingMode auditingMode = typeof(PartiallyAuditedBatchCreationObject).IsAssignableFrom(((ListView)View).ObjectTypeInfo.Type) ? ObjectAuditingMode.CreationOnly : ObjectAuditingMode.Full;

            AuditTrailService.Instance.BeginSessionAudit(session, AuditTrailStrategy.OnObjectChanged, auditingMode);
        }