Exemplo n.º 1
0
 private void LoadFiles()
 {
     stepSequence = FileSystemOperations.LoadConfigFromFile();
     newBrand     = stepSequence.stepBranding;
     newSteps     = stepSequence.steps;
     stepInputs   = stepSequence.stepInputs;
     stepEvals    = stepSequence.stepEvaluations;
     stepActions  = stepSequence.stepActions;
 }
Exemplo n.º 2
0
        private void runStepAction(int actionID)
        {
            foreach (Action actionToExecute in stepActions)
            {
                if (actionToExecute.id == actionID)
                {
                    if (actionToExecute.type == "openURL")
                    {
                        Process.Start(actionToExecute.actionParam1);
                    }
                    if (actionToExecute.type == "runExecutable")
                    {
                        FileSystemOperations.ExecuteProcess(actionToExecute.actionParam1, actionToExecute.actionParam2, actionToExecute.runAsAdmin);
                    }

                    if (actionToExecute.type == "nextStep")
                    {
                        AdvanceStep();
                    }

                    if (actionToExecute.type == "previousStep")
                    {
                        PreviousStep();
                    }


                    if (actionToExecute.type == "enableFormElement")
                    {
                        Control[] controlsByName = this.Controls.Find(actionToExecute.formItemNameToEnable, true);

                        foreach (Control con in controlsByName)
                        {
                            con.Invoke(new MethodInvoker(delegate
                            {
                                con.Enabled = true;
                                con.Visible = true;
                                con.Refresh();
                            }
                                                         ));
                        }
                    }

                    if (actionToExecute.type == "disableFormElement")
                    {
                        Control[] controlsByName = this.Controls.Find(actionToExecute.formItemNameToEnable, true);

                        foreach (Control con in controlsByName)
                        {
                            con.Invoke(new MethodInvoker(delegate
                            {
                                con.Enabled = false;
                                con.Visible = false;
                                con.Refresh();
                            }
                                                         ));
                        }
                    }

                    if (actionToExecute.type == "quit")
                    {
                        Application.Exit();
                    }
                }
            }
        }