public void TextLog_Basic() { string folder = Path.GetTempPath() + Helper.NewGuid().ToString(); TextLog log = null; try { log = new TextLog(folder, 128); for (int i = 0; i < 10; i++) { log.Log("category", "title", "details " + i.ToString()); } Thread.Sleep(2000); for (int i = 10; i < 20; i++) { log.Log("category", "title", "details " + i.ToString()); } // $todo(jeff.lill): For now, you need to set a breakpoint and // manually verify that this worked. } finally { if (log != null) { log.Dispose(); } Helper.DeleteFile(folder, true); } }
public void Dispose() { if (log != null) { log.Dispose(); log = null; } ks.Dispose(); if (Matcher != null) { Matcher.OnBeforeMatch -= matcher_OnBeforeMatch; Matcher.OnFinish -= matcher_OnFinish; Matcher.OnPositionChanged -= matcher_OnPositionChanged; Matcher.OnPartialFinish -= matcher_OnPartialFinish; Matcher.OnDeal -= Matcher_OnDeal; Matcher.Dispose(); Matcher = null; } if (Model != null) { Model.Dispose(); Model = null; } if (Executor != null) { Executor.Dispose(); Executor = null; } }
public void Dispose() { if (log != null) { log.Dispose(); log = null; } if (exeTimer != null) { exeTimer.Elapsed -= exeTimer_Elapsed; exeTimer.Dispose(); exeTimer = null; } }
public void Dispose() { if (log != null) { log.Dispose(); log = null; } if (Container != null) { Container.Orders.Clear(); Container = null; } if (arrangeChecker != null) { arrangeChecker.Dispose(); arrangeChecker = null; } }