static void Main(string[] args) { CommandArguments commandLineArguments = new CommandArguments(args); if (!commandLineArguments.ConsoleExit) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SingleInstanceController controller = new SingleInstanceController(); controller.Run(args); } }
private void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs eventArgs) { string[] args = new string[eventArgs.CommandLine.Count]; eventArgs.CommandLine.CopyTo(args, 0); CommandArguments commandLineArguments = new CommandArguments(args); if (!commandLineArguments.ConsoleExit) { mainForm form = (mainForm)this.MainForm; if (commandLineArguments.HasArguments) { form.LoadDirectories(commandLineArguments); } else { form.RestoreFromTray(); } } }
private void mainForm_Load(object sender, EventArgs e) { string[] args = Environment.GetCommandLineArgs(); CommandArguments commandLineArgs = new CommandArguments(args); if (commandLineArgs.HasArguments) { LoadDirectories(commandLineArgs); } }
public void LoadDirectories(CommandArguments args) { if (args.ClearDirectories) { Program.Settings.DirectoryList.ClearDirectories(); } //load directories specified in arguments foreach (string directoryPath in args.DirectoryPaths) { if(System.IO.Directory.Exists(directoryPath)) { Models.Directory directory = Program.Settings.DirectoryList.AddDirectory(directoryPath); foreach (Models.File file in directory.Files) { file.Minify = args.Minify; if (args.InitialCompile) { file.Compile(); } } } } foldersListBox_DataChanged(); SelectDirectory(); Program.Settings.SaveSettings(); }