Added: open command arg
This commit is contained in:
parent
b228388c41
commit
772967be85
67
MainForm.cs
67
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)
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user