Have double-click on item working now with msi file.

This commit is contained in:
Tim Young 2017-07-28 19:35:27 -05:00
parent e0a65412dd
commit 4b98c5298a
2 changed files with 24 additions and 5 deletions

View File

@ -51,12 +51,16 @@ namespace EduNetworkBuilder
private List<NetworkDevice> ItemsSelected = new List<NetworkDevice>();
private Point OrigClickPoint = new Point(-1, -1);
private string InitialFileLoad = "";
private PersonClass CurrentUser;
public BuilderWindow()
public BuilderWindow(string FirstArg="")
{
InitializeComponent();
InitialFileLoad = FirstArg;
LastPath = OurSettings.LastPath;
if(!OurSettings.LanguageHasBeenChosen)
@ -1638,7 +1642,6 @@ namespace EduNetworkBuilder
private void BuilderWindow_Load(object sender, EventArgs e)
{
if (OurSettings.MainWindowX != -1 && OurSettings.MainWindowY != -1)
{
Location = new Point(OurSettings.MainWindowX, OurSettings.MainWindowY);
@ -1648,8 +1651,11 @@ namespace EduNetworkBuilder
Height = OurSettings.MainWindowHeight;
Width = OurSettings.MainWindowWidth;
}
//If we started by clicking on a file, load that file
if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null && AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null && AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Any())
if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null &&
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null &&
AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Any())
{
string[] activationData = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;
var uri = new Uri(activationData[0]);
@ -1665,6 +1671,16 @@ namespace EduNetworkBuilder
UpdateForm();
}
}
if (InitialFileLoad != "")
{
if (File.Exists(InitialFileLoad))
{
PrepForLoad();
myNetwork.Load(InitialFileLoad);
UpdateMenu();
UpdateForm();
}
}
else
{
if (OurSettings.AutoStartPuzzles)

View File

@ -12,11 +12,14 @@ namespace EduNetworkBuilder
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
static void Main(string[] args)
{
string InitialFile = "";
if(args.Count() > 0)
InitialFile = args[0];
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new BuilderWindow());
Application.Run(new BuilderWindow(InitialFile));
}
}
}