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); }
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); }
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)); }
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)); }
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); } }
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); } }
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); }