Ejemplo n.º 1
0
        /// <summary>
        /// Performs all BAM actions for configured BAM steps in either the first or all
        /// the directives.  Optionally perform BAM actions for all step extensions.
        /// This method can optionally handle step processing after application of a map.
        /// </summary>
        /// <param name="data">The BAM step data.</param>
        /// <param name="depth">
        /// Specify the depth of BAM processing; first or all steps and, optionally,
        /// each step extension.
        /// </param>
        /// <param name="afterMap">Indicates if the step is after the application of a map.</param>
        public void OnStep(BamStepData data, MultiStepControl depth, bool afterMap)
        {
            switch (depth)
            {
            case MultiStepControl.AllSteps:
                foreach (var bamDirective in this.items)
                {
                    bamDirective.OnStep(data, afterMap);
                }

                break;

            case MultiStepControl.AllStepsWithExtensions:
                foreach (var bamDirective in this.items)
                {
                    bamDirective.OnStep(data, afterMap);

                    foreach (var extension in bamDirective.BamStepExtensions)
                    {
                        var eventStream = new TrackpointDirectiveEventStream(bamDirective, data);
                        eventStream.SelectBamStepExtension(extension, afterMap);
                        bamDirective.EventStream = eventStream;
                        bamDirective.OnStep(data, afterMap);
                    }
                }

                break;

            case MultiStepControl.FirstStepOnly:
                this.OnFirstStep(data, afterMap);
                break;

            case MultiStepControl.FirstStepWithExtensions:
                var firstBamDirective = this.items.FirstOrDefault(item => !string.IsNullOrWhiteSpace(item.BamStepName))
                                        ?? this.items.FirstOrDefault(item => !string.IsNullOrWhiteSpace(item.BamAfterMapStepName));

                if (firstBamDirective != null)
                {
                    firstBamDirective.OnStep(data, afterMap);

                    foreach (var extension in firstBamDirective.BamStepExtensions)
                    {
                        var eventStream = new TrackpointDirectiveEventStream(firstBamDirective, data);
                        eventStream.SelectBamStepExtension(extension, afterMap);
                        firstBamDirective.EventStream = eventStream;
                        firstBamDirective.OnStep(data, afterMap);
                    }
                }

                break;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Performs all BAM actions for configured BAM steps in either the first or
 /// all the directives.  Optionally perform BAM actions for all step extensions.
 /// </summary>
 /// <param name="data">The BAM step data.</param>
 /// <param name="depth">
 /// Specify the depth of BAM processing; first or all steps and, optionally,
 /// each step extension.
 /// </param>
 public void OnStep(BamStepData data, MultiStepControl depth)
 {
     this.OnStep(data, depth, false);
 }