Stream(ArrayList data, PlotLogger log) { data.Add(new Snoop.Data.ClassSeparator(typeof(PlotLogger))); data.Add(new Snoop.Data.Bool("Error has happened in job", log.ErrorHasHappenedInJob)); data.Add(new Snoop.Data.Bool("Error has happened in sheet", log.ErrorHasHappenedInSheet)); data.Add(new Snoop.Data.Bool("Warning has happened in job", log.WarningHasHappenedInJob)); data.Add(new Snoop.Data.Bool("Warning has happened in sheet", log.WarningHasHappenedInSheet)); }
CollectEvent(object sender, CollectorEventArgs e) { // cast the sender object to the SnoopCollector we are expecting Collector snoopCollector = sender as Collector; if (snoopCollector == null) { Debug.Assert(false); // why did someone else send us the message? return; } // see if it is a type we are responsible for PlotLogger log = e.ObjToSnoop as PlotLogger; if (log != null) { Stream(snoopCollector.Data(), log); return; } DsdData dsdData = e.ObjToSnoop as DsdData; if (dsdData != null) { Stream(snoopCollector.Data(), dsdData); return; } DsdEntry dsdEntry = e.ObjToSnoop as DsdEntry; if (dsdEntry != null) { Stream(snoopCollector.Data(), dsdEntry); return; } Dwf3dOptions dwf3dOpt = e.ObjToSnoop as Dwf3dOptions; if (dwf3dOpt != null) { Stream(snoopCollector.Data(), dwf3dOpt); return; } BeginDocumentEventArgs beginDocArgs = e.ObjToSnoop as BeginDocumentEventArgs; if (beginDocArgs != null) { Stream(snoopCollector.Data(), beginDocArgs); return; } BeginPageEventArgs beginPageArgs = e.ObjToSnoop as BeginPageEventArgs; if (beginPageArgs != null) { Stream(snoopCollector.Data(), beginPageArgs); return; } BeginPlotEventArgs beginPlotArgs = e.ObjToSnoop as BeginPlotEventArgs; if (beginPlotArgs != null) { Stream(snoopCollector.Data(), beginPlotArgs); return; } EndDocumentEventArgs endDocArgs = e.ObjToSnoop as EndDocumentEventArgs; if (endDocArgs != null) { Stream(snoopCollector.Data(), endDocArgs); return; } EndPageEventArgs endPageArgs = e.ObjToSnoop as EndPageEventArgs; if (endPageArgs != null) { Stream(snoopCollector.Data(), endPageArgs); return; } EndPlotEventArgs endPlotArgs = e.ObjToSnoop as EndPlotEventArgs; if (endPlotArgs != null) { Stream(snoopCollector.Data(), endPlotArgs); return; } PlotInfo plotInfo = e.ObjToSnoop as PlotInfo; if (plotInfo != null) { Stream(snoopCollector.Data(), plotInfo); return; } PlotPageInfo plotPageInfo = e.ObjToSnoop as PlotPageInfo; if (plotPageInfo != null) { Stream(snoopCollector.Data(), plotPageInfo); return; } PlotConfig plotConfig = e.ObjToSnoop as PlotConfig; if (plotConfig != null) { Stream(snoopCollector.Data(), plotConfig); return; } PlotConfigInfo plotConfigInfo = e.ObjToSnoop as PlotConfigInfo; if (plotConfigInfo != null) { Stream(snoopCollector.Data(), plotConfigInfo); return; } PlotEngine plotEngine = e.ObjToSnoop as PlotEngine; if (plotEngine != null) { Stream(snoopCollector.Data(), plotEngine); return; } PlotInfoValidator plotInfoValidator = e.ObjToSnoop as PlotInfoValidator; if (plotInfoValidator != null) { Stream(snoopCollector.Data(), plotInfoValidator); return; } PlotProgress plotProgress = e.ObjToSnoop as PlotProgress; if (plotProgress != null) { Stream(snoopCollector.Data(), plotProgress); return; } // ValueTypes we have to treat a bit different if (e.ObjToSnoop is MediaBounds) { Stream(snoopCollector.Data(), (MediaBounds)e.ObjToSnoop); return; } }