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 override void WriteReport() { // // NORMALIZE THE ACTIVITY POINTS SO ALL ACTIVITIES WITH A START POINT HAVE AN EXPLICIT END POINT. // ActivityPointStack NormalizedPointStack = ActivityPointListNormalizer.Normalize(_ActivityPoints); // // CREATE THE ACTIVITY REPORT ITEM TREE. // ActivityReportItem MarkerReportItem = ActivityReportItemTreeFactory.CreateReportItemTree(NormalizedPointStack); // // CREATE THE REPORT. // string ReportString = CreateReportForActivityReportItem(MarkerReportItem, 0); // // WRITE THE REPORT TO THE TARGET STREAM. // using (StringReader SourceStringReader = new StringReader(ReportString)) { StreamWriter TargetStreamWriter = new StreamWriter(_TargetStream); TargetStreamWriter.Write(SourceStringReader.ReadToEnd()); TargetStreamWriter.Flush(); } }
/// <summary> /// Creates a report for the performance marker. /// </summary> public override void WriteReport() { // // CREATE THE REPORT XML DOCUMENT. // _MarkerReportDocument = new XmlDocument(); // // NORMALIZE THE ACTIVITY POINTS SO ALL ACTIVITIES WITH A START POINT HAVE AN EXPLICIT END POINT. // ActivityPointStack NormalizedPointStack = ActivityPointListNormalizer.Normalize(_ActivityPoints); // // CREATE THE ACTIVITY REPORT ITEM TREE. // ActivityReportItem MarkerReportItem = ActivityReportItemTreeFactory.CreateReportItemTree(NormalizedPointStack); // // CREATE THE REPORT. // _MarkerReportDocument.AppendChild(CreateActivityReportElement(MarkerReportItem)); // // WRITE THE REPORT TO THE TARGET STREAM. // _MarkerReportDocument.Save(_TargetStream); }
public void SetUp() { // // CREATE THE STACK. // List <ActivityPoint> ActivityPointList = new List <ActivityPoint>(); // // CREATE THE MARKER START POINT. // ActivityPoint CreatedPoint = new ActivityPoint(); CreatedPoint.ActivityName = "Marker"; CreatedPoint.PointDateTime = DateTime.UtcNow; CreatedPoint.PointType = ActivityPointType.Start; ActivityPointList.Add(CreatedPoint); // // NORMALIZE. // ActivityPointStack CreatedStack = ActivityPointListNormalizer.Normalize(ActivityPointList.ToArray()); // // GET THE START AND END POINTS. // _StartPoint = CreatedStack.Pop(); _EndPoint = CreatedStack.Pop(); }
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() { // // CREATE THE STACK. // ActivityPointStack CreatedStack = new ActivityPointStack(); // // BUILD THE TREE. // _ReportItem = ActivityReportItemTreeFactory.CreateReportItemTree(CreatedStack); }
public void SetUp() { // // CREATE THE START POINT. // _StartPoint = new ActivityPoint(); _StartPoint.ActivityName = "DoesNotExist"; _StartPoint.PointDateTime = DateTime.UtcNow; _StartPoint.PointType = ActivityPointType.Start; // // CREATE THE STACK. // _Stack = new ActivityPointStack(); }
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); }
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()); }