//--------------------------------------------------------------------- public void ProcessRecord(String name, DateTime DOB) { MethodBase mb = MethodBase.GetCurrentMethod(); ReflectInsight ri = RITraceManager.ActiveLogger; ri.AddCheckpoint(); ri.SendMsg("This is message one in: {0}", mb.Name); ri.SendNote("This is message two in: {0}", mb.Name); DataAccess da = new DataAccess(); da.UpateRecord(name, DateTime.Now.Year - DOB.Year); ri.SendDebug("This is message three in: {0}", mb.Name); ri.SendWarning("This is message four in: {0}", mb.Name); }
public void UpateRecord(String name, Int32 age) { MethodBase mb = MethodBase.GetCurrentMethod(); ReflectInsight ri = RITraceManager.ActiveLogger; ri.AddCheckpoint(); ri.SendMsg("This is message one in: {0}", mb.Name); ri.SendNote("This is message two in: {0}", mb.Name); if (age <= 0) { throw new Exception("Age must be greater than zero."); } ri.SendDebug("This is message three in: {0}", mb.Name); ri.SendWarning("This is message four in: {0}", mb.Name); }
//--------------------------------------------------------------------- public String Method1(String name, DateTime DOB, String SIN) { MethodBase mb = MethodBase.GetCurrentMethod(); ReflectInsight ri = RITraceManager.ActiveLogger; ri.AddCheckpoint(); ri.SendMsg("This is message one in: {0}", mb.Name); ri.SendNote("This is message two in: {0}", mb.Name); ri.SendInformation("SIN: {0}", SIN); Business bus = new Business(); bus.ProcessRecord(name, DOB); ri.SendDebug("This is message three in: {0}", mb.Name); ri.SendWarning("This is message four in: {0}", mb.Name); return(Guid.NewGuid().ToString()); }
static void RunSample() { ReflectInsight ri = new ReflectInsight(); while (true) { Console.WriteLine("Press any key to run test or press 'q' to quit..."); ConsoleKeyInfo k = Console.ReadKey(); if (k.KeyChar == 'q') { break; } ri.SendMsg("Message"); ri.SendDebug("Debug"); ri.SendTrace("Trace"); ri.SendInformation("Information"); ri.SendWarning("Warning"); ri.SendError("Error"); ri.SendFatal("Fatal"); ri.SendException("Exception", new Exception("Look at inner exception for more details", new Exception("Some major exception occurred"))); ri.Send(ReflectSoftware.Insight.Common.MessageType.SendError, "Error with details", "These are the details of this error"); ri.Send(ReflectSoftware.Insight.Common.MessageType.SendTrace, "Trace with details", "These are the details of this trace"); using (DataSet DataSet1 = new DataSet()) { DataSet1.ReadXml(String.Format(@"{0}Samples\dataset.xml", AppDomain.CurrentDomain.BaseDirectory), XmlReadMode.Auto); ri.SendDataTable("Data Table", DataSet1.Tables[3]); } ri.SendImage("Hello, World", String.Format(@"{0}Samples\earth.jpg", AppDomain.CurrentDomain.BaseDirectory)); ri.SendStream("Some Stream", String.Format(@"{0}Samples\Earth.jpg", AppDomain.CurrentDomain.BaseDirectory)); } }