Stream(ArrayList data, AcAp.DocumentLockModeWillChangeEventArgs args) { data.Add(new Snoop.Data.ClassSeparator(typeof(AcAp.DocumentLockModeWillChangeEventArgs))); data.Add(new Snoop.Data.Object("Document", args.Document)); data.Add(new Snoop.Data.String("Global command name", args.GlobalCommandName)); data.Add(new Snoop.Data.String("Current mode", args.CurrentMode.ToString())); data.Add(new Snoop.Data.String("My current mode", args.MyCurrentMode.ToString())); data.Add(new Snoop.Data.String("My new mode", args.MyNewMode.ToString())); }
event_DocumentLockModeWillChange(object sender, AcApp.DocumentLockModeWillChangeEventArgs e) { PrintEventMessage("Document Lock Mode Will Change", e.Document); if (m_showDetails) { PrintSubEventMessage("Global Command Name", e.GlobalCommandName); PrintSubEventMessage("Current Mode", e.CurrentMode.ToString()); PrintSubEventMessage("My Current Mode", e.MyCurrentMode.ToString()); PrintSubEventMessage("My New Mode", e.MyNewMode.ToString()); } }
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; } // branch to all types we are concerned with System.Type type = e.ObjToSnoop as System.Type; if (type != null) { Stream(snoopCollector.Data(), type); return; } System.Version ver = e.ObjToSnoop as System.Version; if (ver != null) { Stream(snoopCollector.Data(), ver); return; } System.Collections.Specialized.StringCollection strCol = e.ObjToSnoop as System.Collections.Specialized.StringCollection; if (strCol != null) { Stream(snoopCollector.Data(), strCol); return; } AcAp.Document doc = e.ObjToSnoop as AcAp.Document; if (doc != null) { Stream(snoopCollector.Data(), doc); return; } AcAp.DocumentCollectionEventArgs docCollectEventArgs = e.ObjToSnoop as AcAp.DocumentCollectionEventArgs; if (docCollectEventArgs != null) { Stream(snoopCollector.Data(), docCollectEventArgs); return; } AcAp.DocumentLockModeWillChangeEventArgs docLockModeEventArgs = e.ObjToSnoop as AcAp.DocumentLockModeWillChangeEventArgs; if (docLockModeEventArgs != null) { Stream(snoopCollector.Data(), docLockModeEventArgs); return; } AcAp.DocumentLockModeChangedEventArgs docLockModeChangedEventArgs = e.ObjToSnoop as AcAp.DocumentLockModeChangedEventArgs; if (docLockModeChangedEventArgs != null) { Stream(snoopCollector.Data(), docLockModeChangedEventArgs); return; } AcAp.DocumentLockModeChangeVetoedEventArgs docLockModeVetoedEventArgs = e.ObjToSnoop as AcAp.DocumentLockModeChangeVetoedEventArgs; if (docLockModeVetoedEventArgs != null) { Stream(snoopCollector.Data(), docLockModeVetoedEventArgs); return; } AcAp.DocumentDestroyedEventArgs docDestroyedEventArgs = e.ObjToSnoop as AcAp.DocumentDestroyedEventArgs; if (docDestroyedEventArgs != null) { Stream(snoopCollector.Data(), docDestroyedEventArgs); return; } AcAp.DocumentCollection docCollection = e.ObjToSnoop as AcAp.DocumentCollection; if (docCollection != null) { Stream(snoopCollector.Data(), docCollection); return; } AcAp.XrefFileLock xrefFileLock = e.ObjToSnoop as AcAp.XrefFileLock; if (xrefFileLock != null) { Stream(snoopCollector.Data(), xrefFileLock); return; } Autodesk.AutoCAD.Windows.Window win = e.ObjToSnoop as Autodesk.AutoCAD.Windows.Window; if (win != null) { Stream(snoopCollector.Data(), win); return; } Autodesk.AutoCAD.Windows.StatusBar statusBar = e.ObjToSnoop as Autodesk.AutoCAD.Windows.StatusBar; if (statusBar != null) { Stream(snoopCollector.Data(), statusBar); return; } Autodesk.AutoCAD.Windows.StatusBarItem statusBarItem = e.ObjToSnoop as Autodesk.AutoCAD.Windows.StatusBarItem; if (statusBarItem != null) { Stream(snoopCollector.Data(), statusBarItem); return; } }