Stream(ArrayList data, GroundConductorSize grndCondSize) { data.Add(new Snoop.Data.ClassSeparator(typeof(GroundConductorSize))); data.Add(new Snoop.Data.Double("Ampacity", grndCondSize.Ampacity)); data.Add(new Snoop.Data.String("Conductor size", grndCondSize.ConductorSize)); data.Add(new Snoop.Data.Object("Material belong to", grndCondSize.MaterialBelongTo)); }
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 Connector connector = e.ObjToSnoop as Connector; if (connector != null) { Utils.StreamWithReflection(snoopCollector.Data(), typeof(Connector), connector); return; } ConnectorManager connectorMgr = e.ObjToSnoop as ConnectorManager; if (connectorMgr != null) { Stream(snoopCollector.Data(), connectorMgr); return; } CorrectionFactor correctionFactor = e.ObjToSnoop as CorrectionFactor; if (correctionFactor != null) { Stream(snoopCollector.Data(), correctionFactor); return; } ElectricalSetting elecSetting = e.ObjToSnoop as ElectricalSetting; if (elecSetting != null) { Stream(snoopCollector.Data(), elecSetting); return; } GroundConductorSize groundConductorSize = e.ObjToSnoop as GroundConductorSize; if (groundConductorSize != null) { Stream(snoopCollector.Data(), groundConductorSize); return; } MEPModel mepModel = e.ObjToSnoop as MEPModel; if (mepModel != null) { Stream(snoopCollector.Data(), mepModel); return; } WireSize wireSize = e.ObjToSnoop as WireSize; if (wireSize != null) { Stream(snoopCollector.Data(), wireSize); return; } }