Added: open command arg

This commit is contained in:
Ray 2020-08-23 14:03:07 +01:00
parent b228388c41
commit 772967be85
2 changed files with 34 additions and 34 deletions

View File

@ -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)

View File

@ -110,6 +110,7 @@
</Compile>
<Compile Include="Models\BookmarkItemModel.cs" />
<Compile Include="RyzStudio\Net\HttpWeb.cs" />
<Compile Include="RyzStudio\Windows\Forms\ThreadControl.cs" />
<Compile Include="Windows\Forms\BookmarkTreeViewSNode.cs" />
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.cs">
<SubType>UserControl</SubType>