Ejemplo n.º 1
0
        private void Win_Loaded(object sender, RoutedEventArgs e)
        {
            Window win = sender as Window;

            CSCS_GUI.AddActions(win, true);

            var funcName = Path.GetFileNameWithoutExtension(win.Tag.ToString()) + "_OnStart";

            CSCS_GUI.RunScript(funcName, win, new Variable(win.Tag));
            Instance.Loaded -= Win_Loaded;
        }
Ejemplo n.º 2
0
        void MainView_Loaded(object sender, RoutedEventArgs e)
        {
            CSCS_SQL.Init();
            CSCS_GUI.MainWindow = this;
            CSCS_GUI.AddActions(CSCS_GUI.MainWindow, true);

            var win = NewWindowFunction.CreateNew("../../scripts/Sample.xaml");

            CSCS_GUI.AddActions(win.Instance, true);

            var res        = this.Resources;
            var cscsScript = (string)res["CSCS"];

            //CSCS_GUI.MainWindow.Tag = "MainWindow";

            Console.WriteLine("Running CSCS script: " + cscsScript);
            CSCS_GUI.RunScript(cscsScript);

            CSCS_GUI.MainWindow = this;

            /*string[] cmdArgs = Environment.GetCommandLineArgs();
             * if (cmdArgs.Length <= 2)
             * {
             *  CSCS_GUI.RunScript(cscsScript);
             *  return;
             * }
             *
             * var cmdLineParams = cmdArgs[2].Split(new char[] { ',' });
             * var scriptName = cmdLineParams[0];
             * /*string msg = "StartArgs:";
             * for (int i = 0; i < cmdArgs.Length; i++)
             * {
             *  msg += " [" + cmdArgs[i] + "]";
             * }
             * msg += " Script: [" + scriptName + "]";
             * MessageBox.Show(msg, cmdArgs.Length + " args", MessageBoxButton.OK, MessageBoxImage.Asterisk);*/

            //CSCS_GUI.RunScript("../../scripts/" + scriptName);
        }