1-
21//
3- // (C) Copyright 2004 by Autodesk, Inc.
2+ // (C) Copyright 2004 by Autodesk, Inc.
43//
54// Permission to use, copy, modify, and distribute this software in
6- // object code form for any purpose and without fee is hereby granted,
7- // provided that the above copyright notice appears in all copies and
5+ // object code form for any purpose and without fee is hereby granted,
6+ // provided that the above copyright notice appears in all copies and
87// that both that copyright notice and the limited warranty and
9- // restricted rights notice below appear in all supporting
8+ // restricted rights notice below appear in all supporting
109// documentation.
1110//
12- // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11+ // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
1312// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
14- // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13+ // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
1514// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
1615// UNINTERRUPTED OR ERROR FREE.
1716//
18- // Use, duplication, or disclosure by the U.S. Government is subject to
17+ // Use, duplication, or disclosure by the U.S. Government is subject to
1918// restrictions set forth in FAR 52.227-19 (Commercial Computer
2019// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
2120// (Rights in Technical Data and Computer Software), as applicable.
2221//
2322
24-
25- using System . Collections ;
2623using Autodesk . AutoCAD . Runtime ;
2724using MgdDbg . App ;
2825using MgdDbg . ObjTests ;
2926using MgdDbg . ObjTests . TestFramework ;
27+ using System . Collections ;
3028
31- [ assembly: ExtensionApplication ( typeof ( App ) ) ]
32- [ assembly: CommandClass ( typeof ( TestCmds ) ) ]
29+ [ assembly: ExtensionApplication ( typeof ( App ) ) ]
30+ [ assembly: CommandClass ( typeof ( TestCmds ) ) ]
3331
3432namespace MgdDbg . App
3533{
36-
37- public class App : IExtensionApplication
38- {
34+ public class App : IExtensionApplication
35+ {
3936 private ArrayList m_tests = new ArrayList ( ) ;
4037 private AppDocReactor m_appDocReactor = null ;
4138
42- public void
43- Initialize ( )
44- {
39+ public void
40+ Initialize ( )
41+ {
4542 Utils . AcadUi . PrintToCmdLine ( "\n Loading MgdDbg..." ) ;
46-
47- // register any Snoop Collector Extension objectsthat we have
43+
44+ // register any Snoop Collector Extension objectsthat we have
4845 Snoop . CollectorExts . Object extObj = new Snoop . CollectorExts . Object ( ) ;
4946 Snoop . CollectorExts . RxObject extRxObj = new Snoop . CollectorExts . RxObject ( ) ;
5047 Snoop . CollectorExts . DbObject extObjects = new Snoop . CollectorExts . DbObject ( ) ;
@@ -60,7 +57,7 @@ public void
6057 Snoop . CollectorExts . Publish extPublish = new Snoop . CollectorExts . Publish ( ) ;
6158 Snoop . CollectorExts . Plotting extPlotting = new Snoop . CollectorExts . Plotting ( ) ;
6259 Snoop . CollectorExts . EditorInput extEdInput = new Snoop . CollectorExts . EditorInput ( ) ;
63-
60+
6461 AppContextMenu . AddContextMenu ( ) ; // add our commands to the App right-click menu
6562
6663 CreateAndAddTestFuncs ( ) ; // populate the TestFramework with our functions
@@ -69,23 +66,23 @@ public void
6966 m_appDocReactor . EnableEvents ( ) ;
7067
7168 AddFilterForSnoopClasses ( ) ;
72- }
73-
74- public void
75- Terminate ( )
76- {
69+ }
70+
71+ public void
72+ Terminate ( )
73+ {
7774 AppContextMenu . RemoveContextMenu ( ) ;
7875 RemoveAndFreeTestFuncs ( ) ;
7976
8077 m_appDocReactor . DisableEvents ( ) ;
81- }
78+ }
8279
8380 /// <summary>
8481 /// The TestFramework allows us to plug tests and sample functions into an existing
8582 /// UI Framework. For each TestFuncs object we've created to house our individual
8683 /// tests, we need to add them during App start up, and remove them during App shut down.
8784 /// </summary>
88-
85+
8986 private void
9087 CreateAndAddTestFuncs ( )
9188 {
@@ -97,7 +94,8 @@ private void
9794 m_tests . Add ( new QueryEntTests ( ) ) ;
9895 m_tests . Add ( new CategoryTests ( ) ) ;
9996
100- foreach ( MgdDbgTestFuncs testFunc in m_tests ) {
97+ foreach ( MgdDbgTestFuncs testFunc in m_tests )
98+ {
10199 MgdDbgTestFuncs . AddTestFuncsToFramework ( testFunc ) ;
102100 }
103101 }
@@ -106,11 +104,12 @@ private void
106104 /// Reverse of above. Nothing to do for each TestFunc object though
107105 /// because we already know which ones were registered for this app.
108106 /// </summary>
109-
107+
110108 private void
111109 RemoveAndFreeTestFuncs ( )
112110 {
113- foreach ( MgdDbgTestFuncs testFunc in m_tests ) {
111+ foreach ( MgdDbgTestFuncs testFunc in m_tests )
112+ {
114113 MgdDbgTestFuncs . RemoveTestFuncsFromFramework ( testFunc ) ;
115114 }
116115 }
@@ -120,22 +119,24 @@ private void
120119 /// dialog get class information from. We don't want to display class info for every
121120 /// assembly in .NET, just the ones we are responsible for. So, it acts as a filter.
122121 /// </summary>
123-
122+
124123 private void
125124 AddFilterForSnoopClasses ( )
126125 {
127126 ArrayList assembliesToLoad = new ArrayList ( ) ;
128-
127+
129128 assembliesToLoad . Add ( "mscorlib" ) ; // for the base System.Object
130129 assembliesToLoad . Add ( "acmgd" ) ;
131130 assembliesToLoad . Add ( "acdbmgd" ) ;
132131
133132 System . Reflection . AssemblyName [ ] assemblyNames = System . Reflection . Assembly . GetExecutingAssembly ( ) . GetReferencedAssemblies ( ) ;
134- foreach ( System . Reflection . AssemblyName assemblyName in assemblyNames ) {
135- if ( assembliesToLoad . Contains ( assemblyName . Name ) ) {
133+ foreach ( System . Reflection . AssemblyName assemblyName in assemblyNames )
134+ {
135+ if ( assembliesToLoad . Contains ( assemblyName . Name ) )
136+ {
136137 MgdDbg . Snoop . Forms . Editor . assemblyNamesToLoad . Add ( assemblyName . FullName ) ;
137138 }
138139 }
139140 }
140- }
141- }
141+ }
142+ }
0 commit comments