示例#1
0
 public void Render(PaySlipInterface payslip, OutInterface output)
 {
     output.Print("Name: " + payslip.Name() + "\n");
     output.Print("Pay Period: " + payslip.PayPeriod() + "\n");
     output.Print("Gross Income: " + payslip.GrossIncome() + "\n");
     output.Print("Income Tax: " + payslip.Tax() + "\n");
     output.Print("Net Income: " + payslip.NetIncome() + "\n");
     output.Print("Super: " + payslip.Super() + "\n");
 }
 public void SendScripThreadProc(object script)
 {
     try
     {
         OutInterface.ExecuteScript((string)script);
     }
     catch (Exception e)
     {
         // do nothing, this happens if GView isn't connected
         //throw e;
     }
 }
 public void RefreshVariablesThreadProc(object showError)
 {
     try
     {
         OutInterface.RefreshVariables();
     }
     catch (Exception e)
     {
         if ((bool)showError)
         {
             OnConnectionFail(e, false);
         }
     }
 }
 public void RefreshCurrentElementThreadProc(object showError)
 {
     try
     {
         OutInterface.RefreshCurrentElement();
     }
     catch (Exception e)
     {
         if ((bool)showError)
         {
             OnConnectionFail(e);
         }
     }
 }
 public void UnloadProjectThreadProc(object showError)
 {
     try
     {
         OutInterface.UnloadGlux();
     }
     catch (Exception e)
     {
         if ((bool)showError)
         {
             OnConnectionFail(e, false);
         }
     }
 }
示例#6
0
 public void SetGlueProjectThreadProc(object showError)
 {
     try
     {
         OutInterface.LoadGluxFile(ProjectManager.GlueProjectFileName);
     }
     catch (Exception e)
     {
         if ((bool)showError)
         {
             OnConnectionFail(e);
         }
     }
 }
示例#7
0
 public void ShowElementThreadProc(object showError)
 {
     try
     {
         OutInterface.ShowElement(EditorLogicSnapshot.CurrentElement.Name);
     }
     catch (Exception e)
     {
         if ((bool)showError)
         {
             OnConnectionFail(e);
         }
     }
 }
 public void RefreshFileThreadProc(object args)
 {
     object[] array = args as object[];
     try
     {
         OutInterface.RefreshFile((string)array[1]);
     }
     catch (Exception e)
     {
         if ((bool)array[0])
         {
             OnConnectionFail(e);
         }
     }
 }
示例#9
0
        public void HighlightElementThreadProc(object showError)
        {
            try
            {
                if (EditorLogicSnapshot.CurrentNamedObject != null)
                {
                    OutInterface.HighlightElement(EditorLogicSnapshot.CurrentNamedObject.InstanceName);
                }
            }

            catch (Exception e)
            {
                if ((bool)showError)
                {
                    OnConnectionFail(e);
                }
            }
        }
        public void Run(InputReaderInterface inputReader, InputValidatorInterface validator,
                        DisplayMessageInterface messages, OutInterface outputWriter, PayslipRendererInterface payslipRenderer)
        {
            outputWriter.Print(messages.Welcome());
            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.GetName());
            var firstName = validator.ValidateName(inputReader.Read());

            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.GetSurname());
            var surname = validator.ValidateName(inputReader.Read());

            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.GetSalary());
            var salary = validator.ValidateInteger(inputReader.Read());

            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.GetSuperRate());
            var super = validator.ValidateInteger(inputReader.Read());

            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.GetPaymentStartDate());
            var startDate = validator.ValidateDate(inputReader.Read());

            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.GetPaymentEndDate());
            var endDate = validator.ValidateDate(inputReader.Read());

            outputWriter.Print(messages.NewLine());

            var payslip = new PaySlip(firstName, surname, salary, super, startDate, endDate);

            payslipRenderer.Render(payslip, outputWriter);
            outputWriter.Print(messages.NewLine());

            outputWriter.Print(messages.ThankUser());
        }
        public void SetStateThreadProc(object showError)
        {
            try
            {
                string currentState = null;

                if (EditorLogicSnapshot.CurrentState != null)
                {
                    currentState = EditorLogicSnapshot.CurrentState.Name;
                }
                OutInterface.SetState(currentState);
            }
            catch (Exception e)
            {
                if ((bool)showError)
                {
                    OnConnectionFail(e);
                }
            }
        }
 public void RefreshGlueProjectThreadProc(object showError)
 {
     try
     {
         if (OutInterface == null)
         {
             PluginManager.ReceiveOutput("Error trying to send refresh glue project to GlueView - OutInterface is null");
         }
         else
         {
             OutInterface.RefreshGlueProject();
         }
     }
     catch (Exception e)
     {
         if ((bool)showError)
         {
             OnConnectionFail(e);
         }
     }
 }
 public void Render(PaySlipInterface payslip, OutInterface output)
 {
     output.Print("test");
 }
示例#14
0
 public UserInputValidator(InputReaderInterface reader, OutInterface writer, DisplayMessageInterface messages)
 {
     _reader   = reader;
     _writer   = writer;
     _messages = messages;
 }