public ExecuteOpOnScheduleOp DeepCloneWithOperation(IVoidOperation operation)
        {
            var result = new ExecuteOpOnScheduleOp(
                this.Id?.DeepClone(),
                operation,
                this.Schedule?.DeepClone());

            return(result);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CheckRecordExistsOp"/> class.
        /// </summary>
        /// <param name="id">The identifier of the scheduled operation.</param>
        /// <param name="operation">The operation to run on a schedule.</param>
        /// <param name="schedule">The schedule to execute the operation on.</param>
        public ExecuteOpOnScheduleOp(
            string id,
            IVoidOperation operation,
            ISchedule schedule)
        {
            operation.MustForArg(nameof(operation)).NotBeNull();
            schedule.MustForArg(nameof(schedule)).NotBeNull();

            this.Id        = id;
            this.Operation = operation;
            this.Schedule  = schedule;
        }
        public ScheduledExecutionEvent DeepCloneWithOperationExecuted(IVoidOperation operationExecuted)
        {
            var result = new ScheduledExecutionEvent(
                this.Id?.DeepClone(),
                operationExecuted,
                this.Schedule?.DeepClone(),
                this.PreviousExecutionTimestampUtc?.DeepClone(),
                this.TimestampUtc.DeepClone(),
                this.Tags?.DeepClone());

            return(result);
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduledExecutionEvent"/> class.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="operationExecuted">The <see cref="IVoidOperation"/> executed.</param>
        /// <param name="schedule">The <see cref="ISchedule"/> evaluated.</param>
        /// <param name="previousExecutionTimestampUtc">The previous execution timestamp in UTC format.</param>
        /// <param name="timestampUtc">The timestamp of the event in UTC format.</param>
        /// <param name="tags">The tags associated with the reaction.</param>
        public ScheduledExecutionEvent(
            string id,
            IVoidOperation operationExecuted,
            ISchedule schedule,
            DateTime?previousExecutionTimestampUtc,
            DateTime timestampUtc,
            IReadOnlyCollection <NamedValue <string> > tags = null) : base(id, timestampUtc)
        {
            operationExecuted.MustForArg(nameof(operationExecuted)).NotBeNull();
            schedule.MustForArg(nameof(schedule)).NotBeNull();
            previousExecutionTimestampUtc.MustForArg(nameof(previousExecutionTimestampUtc)).BeUtcDateTimeWhenNotNull();

            this.OperationExecuted             = operationExecuted;
            this.Schedule                      = schedule;
            this.PreviousExecutionTimestampUtc = previousExecutionTimestampUtc;
            this.Tags = tags;
        }