Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the EventSourceActivity class that
        /// is attached to the specified parent activity.
        /// The activity is created in the Initialized state. Call Start() to
        /// write the activity's Start event.
        /// </summary>
        /// <param name="parentActivity">
        /// The parent activity. Activity events will be written
        /// to the event source attached to this activity.
        /// </param>
        /// <param name="startStopOptions">
        /// The options to use for the start and stop events of the activity.
        /// Note that the Opcode property will be ignored.
        /// </param>
        internal EventSourceActivity(EventSourceActivity parentActivity, EventSourceOptions startStopOptions)
        {
            Contract.Requires <ArgumentNullException>(parentActivity != null, nameof(parentActivity));

            _eventSource      = parentActivity.EventSource;
            _startStopOptions = startStopOptions;
            _parentId         = parentActivity.Id;
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the EventSourceActivity class that
 /// is attached to the specified parent activity.
 /// The activity is created in the Initialized state. Call Start() to
 /// write the activity's Start event.
 /// </summary>
 /// <param name="parentActivity">
 /// The parent activity. Activity events will be written
 /// to the event source attached to this activity.
 /// </param>
 internal EventSourceActivity(EventSourceActivity parentActivity)
     : this(parentActivity, new EventSourceOptions())
 {
 }