示例#1
0
        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;
            }
        }
示例#2
0
 event_DocumentDestroyed(object sender, AcApp.DocumentDestroyedEventArgs e)
 {
     PrintEventMessage("Document Destroyed", e.FileName);
 }
示例#3
0
        Stream(ArrayList data, AcAp.DocumentDestroyedEventArgs args)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(AcAp.DocumentDestroyedEventArgs)));

            data.Add(new Snoop.Data.String("File name", args.FileName));
        }