@@ -27,19 +27,18 @@ public static void OnLoaded()
2727 {
2828 try
2929 {
30- applicationLoaded = true ;
31- var dllfolder = GetSettingsFolder ( ) ;
32- settingsFolder = dllfolder ;
33-
34- var settings = GetSettings ( ) ;
35-
30+ applicationLoaded = true ;
31+ var dllfolder = GetSettingsFolder ( ) ;
32+ settingsFolder = dllfolder ;
33+
34+ var settings = GetSettings ( ) ;
35+
3636 //var assemblyName = "CommandLoaderAssembly";
3737 //var dllfullpath = Path.Combine(dllfolder, assemblyName + ".dll");
3838 //CreateCommandLoaderAssembly(settings, dllfolder, assemblyName);
39+ //seems like I need to pre-load my dependencies
40+ AppDomain . CurrentDomain . Load ( typeof ( NpsConfig ) . Assembly . GetName ( ) ) ;
3941
40- //seems like I need to pre-load my dependencies
41- AppDomain . CurrentDomain . Load ( typeof ( NpsConfig ) . Assembly . GetName ( ) ) ;
42-
4342 ExecuteStartupScript ( ) ;
4443 return ;
4544 }
@@ -56,8 +55,8 @@ private static void ExecuteStartupScript()
5655 var startupScript = GetStartupScript ( ) ;
5756 if ( startupScript != null )
5857 {
59- var executor = new ScriptExecutor ( GetConfig ( ) ) ;
60- var result = executor . ExecuteScript ( startupScript , GetStartupScriptPath ( ) ) ;
58+ var executor = new ScriptExecutor ( GetConfig ( ) ) ;
59+ var result = executor . ExecuteScript ( startupScript , GetStartupScriptPath ( ) ) ;
6160 if ( result == - 1 )
6261 {
6362 Forms . MessageBox . Show ( executor . Message , "NavisPythonShell - StartupScript" ) ;
@@ -117,10 +116,10 @@ public static void OnUnloading()
117116 // FIXME: deallocate the python shell...
118117 return ;
119118 }
120-
119+
121120 public static IRpsConfig GetConfig ( )
122- {
123- return new NpsConfig ( GetSettingsFile ( ) ) ;
121+ {
122+ return new NpsConfig ( GetSettingsFile ( ) ) ;
124123 }
125124
126125 /// <summary>
@@ -145,12 +144,12 @@ private static string GetSettingsFile()
145144 /// </summary>
146145 private static string GetSettingsFolder ( )
147146 {
148- if ( ! string . IsNullOrEmpty ( settingsFolder ) )
149- {
150- return settingsFolder ;
151- }
152- //return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NavisPythonShell" + versionNumber);
153- return Path . GetDirectoryName ( typeof ( NavisPythonShellApplication ) . Assembly . Location ) ;
147+ if ( ! string . IsNullOrEmpty ( settingsFolder ) )
148+ {
149+ return settingsFolder ;
150+ }
151+ //return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NavisPythonShell" + versionNumber);
152+ return Path . GetDirectoryName ( typeof ( NavisPythonShellApplication ) . Assembly . Location ) ;
154153 }
155154
156155 /// <summary>
@@ -166,7 +165,7 @@ public static IEnumerable<Command> GetCommands(XDocument repository)
166165 var commandName = commandNode . Attribute ( "name" ) . Value ;
167166 var commandSrc = commandNode . Attribute ( "src" ) . Value ;
168167 var group = commandNode . Attribute ( "group" ) == null ? "" : commandNode . Attribute ( "group" ) . Value ;
169-
168+
170169 ImageSource largeImage = null ;
171170 if ( IsValidPath ( commandNode . Attribute ( "largeImage" ) ) )
172171 {
@@ -188,14 +187,15 @@ public static IEnumerable<Command> GetCommands(XDocument repository)
188187 {
189188 smallImage = GetEmbeddedPng ( addinAssembly , "NavisPythonShell.Resources.PythonScript16x16.png" ) ;
190189 }
191-
192- yield return new Command {
193- Name = commandName ,
194- Source = commandSrc ,
195- Group = group ,
196- LargeImage = largeImage ,
197- SmallImage = smallImage ,
198- Index = i ++
190+
191+ yield return new Command
192+ {
193+ Name = commandName ,
194+ Source = commandSrc ,
195+ Group = group ,
196+ LargeImage = largeImage ,
197+ SmallImage = smallImage ,
198+ Index = i ++
199199 } ;
200200 }
201201 }
@@ -334,7 +334,7 @@ public static string GetStartupScript()
334334 /// </summary>
335335 public static void WriteSettings (
336336 IEnumerable < Command > commands ,
337- IEnumerable < string > searchPaths ,
337+ IEnumerable < string > searchPaths ,
338338 IEnumerable < KeyValuePair < string , string > > variables ,
339339 string initScript ,
340340 string startupScript )
@@ -368,13 +368,13 @@ public static void WriteSettings(
368368 foreach ( var command in commands )
369369 {
370370 xmlCommands . Add ( new XElement (
371- "Command" ,
372- new XAttribute ( "name" , command . Name ) ,
371+ "Command" ,
372+ new XAttribute ( "name" , command . Name ) ,
373373 new XAttribute ( "src" , command . Source ) ,
374374 new XAttribute ( "group" , command . Group ) ) ) ;
375375
376376 }
377- doc . Root . Add ( xmlCommands ) ;
377+ doc . Root . Add ( xmlCommands ) ;
378378
379379 // add search paths
380380 var xmlSearchPaths = new XElement ( "SearchPaths" ) ;
@@ -423,7 +423,7 @@ internal class Command
423423 public string Source ;
424424 public int Index ;
425425 public ImageSource LargeImage ;
426- public ImageSource SmallImage ;
426+ public ImageSource SmallImage ;
427427
428428 public override string ToString ( )
429429 {
0 commit comments