diff --git a/MainForm.cs b/MainForm.cs index 0ed09a3..5704146 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -83,46 +83,45 @@ namespace bzit.bomg this.Location = Screen.PrimaryScreen.WorkingArea.Location; // command line - //string[] szr = Environment.GetCommandLineArgs(); - //int i = 0; - //while (true) - //{ - // if (i > (szr.Length - 1)) - // { - // break; - // } + string[] args = Environment.GetCommandLineArgs(); - // switch (szr[i].Trim().ToLower()) - // { - // case "-o": - // case "-open": - // if ((i + 1) > (szr.Length - 1)) - // { - // break; - // } + if (args.Length > 1) + { + int i = 1; + while (true) + { + if (i > (args.Length - 1)) + { + break; + } - // sessionFilename = szr[(i + 1)]; + switch (args[i].Trim().ToLower()) + { + case "-o": + case "-open": + if ((i + 1) > (args.Length - 1)) break; - // if (string.IsNullOrEmpty(sessionFilename)) - // { - // sessionFilename = null; - // break; - // } + string openFilename = args[(i + 1)]; + if (string.IsNullOrWhiteSpace(openFilename)) break; + if (!File.Exists(openFilename)) break; - // if (!File.Exists(sessionFilename)) - // { - // sessionFilename = null; - // break; - // } + string openExtension = Path.GetExtension(openFilename).Trim('.'); + if (openExtension.Equals("jsnx", StringComparison.CurrentCultureIgnoreCase)) + { + loadBookmarkFile(openFilename, 1); + } + else if (openExtension.Equals("ryz", StringComparison.CurrentCultureIgnoreCase)) + { + loadBookmarkFile(openFilename, 2); + } - // OpenBookmarkFile(sessionFilename); + i++; + break; + } - // i++; - // break; - // } - - // i++; - //} + i++; + } + } } protected override void OnFormClosing(FormClosingEventArgs e) diff --git a/bomg.csproj b/bomg.csproj index aa0b82b..c051be6 100644 --- a/bomg.csproj +++ b/bomg.csproj @@ -110,6 +110,7 @@ + UserControl