Пример #1
0
        /// <summary>
        /// Construct scope
        /// </summary>
        /// <param name="context">work context</param>
        /// <param name="message">message (optional)</param>
        /// <param name="eventLog">event log (optional, default is toolbox's event source</param>
        public ActivityScope(IWorkContext context, string message = null, IEventLog eventLog = null)
        {
            Verify.IsNotNull(nameof(context), context);

            Context   = context;
            EventLog  = eventLog ?? ToolboxEventSource.Log;
            Message   = message;
            Stopwatch = Stopwatch.StartNew();

            EventLog.ActivityStart(Context, Message);
        }