예제 #1
0
파일: Program.cs 프로젝트: boxatom/WinLess
 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);
     }
 }
예제 #2
0
        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();
                }
            }
        }
예제 #3
0
파일: mainForm.cs 프로젝트: rs3d/WinLess
 private void mainForm_Load(object sender, EventArgs e)
 {
     string[] args = Environment.GetCommandLineArgs();
     CommandArguments commandLineArgs = new CommandArguments(args);
     if (commandLineArgs.HasArguments)
     {
         LoadDirectories(commandLineArgs);
     }
 }
예제 #4
0
파일: mainForm.cs 프로젝트: rs3d/WinLess
        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();
        }