From bcd1221a93f8508d8231d7fac2a5877579b650ca Mon Sep 17 00:00:00 2001 From: alcexhim Date: Thu, 25 Sep 2014 14:32:06 -0400 Subject: [PATCH] Support automatically opening specified files at startup --- .../Configuration/Application.xml | 6 ++++++ CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Configuration/Application.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Configuration/Application.xml index 7037f853..fce61a2a 100644 --- a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Configuration/Application.xml +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Configuration/Application.xml @@ -3,6 +3,12 @@ + + + + C:\Temp\UETEST\uetest.farc + + \ No newline at end of file diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs index 15a6dd60..0ef6acc9 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs @@ -966,6 +966,15 @@ namespace UniversalEditor.UserInterface Array.Copy(args1, 1, args, 0, args.Length); System.Collections.ObjectModel.Collection selectedFileNames = new System.Collections.ObjectModel.Collection(); + if (selectedFileNames.Count == 0 || ConfigurationManager.GetValue(new string[] { "Application", "Startup", "ForceLoadStartupFileNames" }, false)) + { + object[] oStartupFileNames = ConfigurationManager.GetValue(new string[] { "Application", "Startup", "FileNames" }, new object[0]); + for (int i = 0; i < oStartupFileNames.Length; i++) + { + string startupFileName = oStartupFileNames[i].ToString(); + selectedFileNames.Add(startupFileName); + } + } foreach (string commandLineArgument in args) { selectedFileNames.Add(commandLineArgument);