コード例 #1
0
ファイル: FrameLogModule.cs プロジェクト: pennsong/OB
 public FrameLogModule(IChangeSetFactory <TChangeSet, TPrincipal> factory,
                       IFrameLogContext <TChangeSet, TPrincipal> context)
 {
     this.factory = factory;
     this.context = context;
     this.filter  = LoggingFilter.Get(context);
     Enabled      = true;
 }
コード例 #2
0
 public FrameLogModule(IChangeSetFactory <TChangeSet, TPrincipal> factory,
                       IFrameLogContext <TChangeSet, TPrincipal> context,
                       ILoggingFilterProvider filter = null)
 {
     this.factory = factory;
     this.context = context;
     this.filter  = (filter ?? Filters.Default).Get(context);
     Enabled      = true;
 }
コード例 #3
0
 public ChangeLogger(IFrameLogContext <TChangeSet, TPrincipal> context,
                     IChangeSetFactory <TChangeSet, TPrincipal> factory,
                     ILoggingFilter filter)
 {
     this.context  = context;
     this.factory  = factory;
     this.recorder = new Recorder <TChangeSet, TPrincipal>(factory);
     this.filter   = filter;
 }
コード例 #4
0
 public FrameLogModule(IChangeSetFactory <TChangeSet, TPrincipal> factory,
                       IFrameLogContext <TChangeSet, TPrincipal> context,
                       ILoggingFilterProvider filter    = null,
                       ISerializationManager serializer = null)
 {
     this.factory    = factory;
     this.context    = context;
     this.filter     = (filter ?? Filters.Default).Get(context);
     this.serializer = (serializer ?? new ValueTranslationManager(context));
     Enabled         = true;
 }
コード例 #5
0
 /// <summary>
 /// Gets (or constructs) the FilterAttributeCache for the database in question.
 /// A typical application will only have one FilterAttributeCache for its lifetime,
 /// but it is possible to be running FrameLog on multiple databases simultaneously.
 /// We use the IFrameLogContext.UnderlyingType to create one FilterAttributeCache per
 /// database-type.
 /// </summary>
 internal static FilterAttributeCache For(IFrameLogContext context)
 {
     var id = context.UnderlyingContextType;
     lock (caches)
     {
         FilterAttributeCache filter;
         if (!caches.TryGetValue(id, out filter))
         {
             filter = caches[id] = new FilterAttributeCache(context.Workspace);
         }
         return filter;
     }
 }
コード例 #6
0
        /// <summary>
        /// Gets (or constructs) the FilterAttributeCache for the database in question.
        /// A typical application will only have one FilterAttributeCache for its lifetime,
        /// but it is possible to be running FrameLog on multiple databases simultaneously.
        /// We use the IFrameLogContext.UnderlyingType to create one FilterAttributeCache per
        /// database-type.
        /// </summary>
        internal static FilterAttributeCache For(IFrameLogContext context)
        {
            var id = context.UnderlyingContextType;

            lock (caches)
            {
                FilterAttributeCache filter;
                if (!caches.TryGetValue(id, out filter))
                {
                    filter = caches[id] = new FilterAttributeCache(context.Workspace);
                }
                return(filter);
            }
        }
コード例 #7
0
ファイル: LoggingFilter.cs プロジェクト: pennsong/OB
        /// <summary>
        /// Gets (or constructs) the LoggingFilter for the database in question.
        /// A typical application will only have one LoggingFilter for its lifetime,
        /// but it is possible to be running FrameLog on multiple databases simultaneously.
        /// We use the IFrameLogContext.UnderlyingType to create one LoggingFilter per
        /// database-type.
        /// </summary>
        internal static LoggingFilter Get <TChangeSet, TPrincipal>(IFrameLogContext <TChangeSet, TPrincipal> context)
            where TChangeSet : IChangeSet <TPrincipal>
        {
            var id = context.UnderlyingContextType;

            lock (filters)
            {
                LoggingFilter filter;
                if (!filters.TryGetValue(id, out filter))
                {
                    filter = filters[id] = new LoggingFilter(context.Workspace);
                }
                return(filter);
            }
        }
コード例 #8
0
 public AttributeBasedLoggingFilter(IFrameLogContext context)
 {
     cache = FilterAttributeCache.For(context);
 }
コード例 #9
0
 public ILoggingFilter Get(IFrameLogContext context)
 {
     return new BlacklistLoggingFilter(context);
 }
コード例 #10
0
 public BlacklistLoggingFilter(IFrameLogContext context)
     : base(context)
 {
 }
コード例 #11
0
 public WhitelistLoggingFilter(IFrameLogContext context)
     : base(context)
 {
 }
コード例 #12
0
 public AttributeBasedLoggingFilter(IFrameLogContext context)
 {
     cache = FilterAttributeCache.For(context);
 }
コード例 #13
0
 public ILoggingFilter Get(IFrameLogContext context)
 {
     return(new BlacklistLoggingFilter(context));
 }
コード例 #14
0
 public BlacklistLoggingFilter(IFrameLogContext context)
     : base(context)
 {
 }
コード例 #15
0
 public WhitelistLoggingFilter(IFrameLogContext context)
     : base(context)
 {
 }