Example #1
0
        public void addWindow(Window wnd)
        {
            janelas.Add(wnd);

            janelaIndex++;

            String[]           cmd = null;
            SingleInstance.App app = (SingleInstance.App)Application.Current;
            cmd = app.commandLine;
            String cmd_str = null;

            if (cmd != null)
            {
                foreach (string str in cmd)
                {
                    cmd_str += str + " ";
                }
            }

            bool bfile = System.IO.File.Exists(cmd_str);

            if (bfile == true)
            {
                wnd.Title = cmd_str;
                cmd_str   = System.IO.File.ReadAllText(cmd_str);
            }



            if (cmd == null)
            {
                cmd_str = "sem linha de argumentos";
            }
            ((WndEditor)wnd).addText(cmd_str);

            JanelaPlaceHolder holder = new JanelaPlaceHolder(wnd);

            listJanelas.Items.Add(holder);


            this.Activate();
            wnd.Activate();
        }
Example #2
0
        protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e)
        {
            app = new SingleInstance.App();

            if (e.CommandLine.Count > 0)
            {
                String[] cmdLine = new string[1];
                cmdLine[0]      = e.CommandLine[0];
                app.commandLine = cmdLine;
                //
            }

            app.InitializeComponent();

            app.Run();



            return(false);
        }