/// <summary> /// Start to dump current date/time and start watch count. /// </summary> /// <param name="curDoc">Current document.</param> /// <param name="isViewWatch">Indicates if current watch is for view or document. /// True means we need to start watch for ViewPrint, else start watch for DocumentPrint.</param> private void StartNewWatch(Document curDoc, bool isViewWatch) { // Just dump current date time to printlog.txt DumpDateTime("Start"); // // Start new watch for view print or document print EventsWatches watches; bool result = m_docEventsWatches.TryGetValue(curDoc.GetHashCode(), out watches); if (!result || null == watches) { watches = new EventsWatches(); m_docEventsWatches.Add(curDoc.GetHashCode(), watches); } // // Start watch for ViewPrint and DocumentPrint if (isViewWatch) { watches.ViewPrintWatch = Stopwatch.StartNew(); } else { watches.DocPrintWatch = Stopwatch.StartNew(); } }
/// <summary> /// Start to dump current date/time and start watch count. /// </summary> /// <param name="curDoc">Current document.</param> /// <param name="isViewWatch">Indicates if current watch is for view or document. /// True means we need to start watch for ViewPrint, else start watch for DocumentPrint.</param> private void StartNewWatch(Document curDoc, bool isViewWatch) { // Just dump current date time to printlog.txt DumpDateTime("Start"); // // Start new watch for view print or document print EventsWatches watches; bool result = m_docEventsWatches.TryGetValue(curDoc.GetHashCode(), out watches); if (!result || null == watches) { watches = new EventsWatches(); m_docEventsWatches.Add(curDoc.GetHashCode(), watches); } // // Start watch for ViewPrint and DocumentPrint if (isViewWatch) { watches.ViewPrintWatch = Stopwatch.StartNew(); } else { watches.DocPrintWatch = Stopwatch.StartNew(); } }