Example #1
0
        public void SetUp()
        {
            //
            // CREATE THE STACK.
            //
            ActivityPointStack CreatedStack = new ActivityPointStack();

            //
            // CREATE THE END POINT.
            //
            _EndPoint = new ActivityPoint();
            _EndPoint.ActivityName  = "Marker";
            _EndPoint.PointDateTime = DateTime.UtcNow;
            _EndPoint.PointType     = ActivityPointType.End;
            CreatedStack.Push(_EndPoint);

            //
            // CREATE THE START POINT.
            //
            ActivityPoint StartPoint = new ActivityPoint();

            StartPoint.ActivityName  = "Marker";
            StartPoint.PointDateTime = DateTime.UtcNow;
            StartPoint.PointType     = ActivityPointType.Start;
            CreatedStack.Push(StartPoint);

            //
            // GET THE END POINT.
            //
            _EndPoint = ActivityPointListNormalizer.GetEndPoint(StartPoint, CreatedStack);
        }
        public static string CreateLines(ActivityPointStack StackParam)
        {
            ActivityPointStack TempStack = new ActivityPointStack();

            try
            {
                StringBuilder PrintStringBuilder = new StringBuilder();
                PrintStringBuilder.AppendLine("ActivityName,PointDateTime,PointType,SequenceNumber");

                while (StackParam.IsNotEmpty)
                {
                    ActivityPoint CurrentPoint = StackParam.Pop();
                    PrintStringBuilder.AppendLine(CreateLine(CurrentPoint));
                    TempStack.Push(CurrentPoint);
                }

                return(PrintStringBuilder.ToString());
            }
            finally
            {
                while (TempStack.IsNotEmpty)
                {
                    StackParam.Push(TempStack.Pop());
                }
            }
        }
        public void SetUp()
        {
            //
            // FAKE THE TIMES.
            //
            DateTime StartPointDateTime = DateTime.UtcNow;

            //
            // CREATE THE STACK.
            //
            ActivityPointStack CreatedStack = new ActivityPointStack();

            //
            // CREATE THE MARKER END POINT.
            //
            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName  = "Marker";
                CreatedPoint.PointDateTime = StartPointDateTime.AddSeconds(1);
                CreatedPoint.PointType     = ActivityPointType.End;
                CreatedStack.Push(CreatedPoint);
            }

            //
            // CREATE THE MARKER START POINT.
            //
            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName  = "Marker";
                CreatedPoint.PointDateTime = StartPointDateTime;
                CreatedPoint.PointType     = ActivityPointType.Start;
                CreatedStack.Push(CreatedPoint);
            }

            //
            // BUILD THE TREE.
            //
            _ReportItem = ActivityReportItemTreeFactory.CreateReportItemTree(CreatedStack);
        }
Example #4
0
        public void SetUp()
        {
            //
            // CREATE THE STARTING POINT TIME.
            //
            DateTime StartPointDateTime = DateTime.Parse("2018-01-01T00:00:00");
            double   TimeIncrement      = 1d;
            int      SequenceNumber     = 0;

            //
            // CREATE THE STACK.
            //
            ActivityPointStack CreatedStack = new ActivityPointStack();

            //
            // CREATE THE MARKER START POINT.
            //
            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "CreatedMarker";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.Start;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "P";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.Start;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "P";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.End;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "Q";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.Start;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "Q";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.End;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "R";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.Start;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "R";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.End;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            //
            // CREATE THE MARKER END POINT.
            //
            {
                ActivityPoint CreatedPoint = new ActivityPoint();
                CreatedPoint.ActivityName   = "CreatedMarker";
                CreatedPoint.PointDateTime  = StartPointDateTime.AddSeconds(SequenceNumber * TimeIncrement);
                CreatedPoint.PointType      = ActivityPointType.End;
                CreatedPoint.SequenceNumber = SequenceNumber++;
                CreatedStack.Push(CreatedPoint);
            }

            //
            // BUILD THE TREE.
            //
            _ReportItem = ActivityReportItemTreeFactory.CreateReportItemTree(CreatedStack.Flip());
        }