Exemplo n.º 1
0
 public static void ShowEdit()
 {
     WriteToConsole.Write("\n-------------------------------------------------------------");
     WriteToConsole.Write("|                     EDIT CALCULATION                      |");
     WriteToConsole.Write("-------------------------------------------------------------\n");
     WriteToConsole.Write("What Operation Do You Want To Change This Calculation To?");
 }
Exemplo n.º 2
0
 private static void RunTool(Configuration config)
 {
     while (true)
     {
         Bitmap image = TakeScreenshot();
         string time  = DateTime.Now.ToString("t");
         if (HasExitButton(image))
         {
             WriteToConsole.Text($"{time} - The Run #Col:Green#ended!#");
             if (config.notifyOnFinish == true)
             {
                 for (int i = 0; i < config.numberOfNotifications; i++)
                 {
                     Console.Beep();
                     Thread.Sleep(300);
                 }
             }
             if (shutDownOnFinish == true)
             {
                 Process.Start("shutdown", "/s /t 0");
             }
             break;
         }
         WriteToConsole.Text($"{time} - The Run #Col:Red#did not end yet!#");
         Thread.Sleep(config.sleepTimerInSeconds * 1000);
     }
     WriteToConsole.Text("#Col:Green#Done!# Press any Key to get Back to the Main Menu.");
     Console.ReadKey();
 }
        public void Previous(ICalculatorComponent calculator)
        {
            Index += PreviousI;
            bool end  = EndOfCollection();
            int  temp = Index;

            while (temp >= 0)
            {
                while (!end)
                {
                    ShowSingle(Index, calculator);
                    end = true;
                }

                temp = -1;
            }

            temp = Index;
            while (temp < 0)
            {
                Index = 0;
                temp  = Index;
                WriteToConsole.Write("\nYou are at the beginning of the calculation history.");
                First(calculator);
            }
        }
Exemplo n.º 4
0
        public static void CheckOut(bool IsCheckout)
        {
            if (IsCheckout)
            {
                WriteToConsole.ItemSummary();
                PaymentTypeController.GetPayment();
                WriteToConsole.PrintReceipt();

                if (WriteToConsole.ShopAgain() == "y")
                {
                    ShoppingCart.Cart.Clear();
                    Console.Clear();
                    InitApp();
                }
                else
                {
                    WriteToConsole.GoodBye();
                }
            }
            else
            {
                Console.Clear();
                InitApp();
            }
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Writer writer = new Writer();

            WriteToConsole wtc = Writer.WriteChapterHeader;

            wtc += writer.WriteChapterText;

            wtc("Chapter One");
        }
Exemplo n.º 6
0
 public static void Options()
 {
     WriteToConsole.Write("\n----------------------------------------------------------------------------------------------------------");
     WriteToConsole.Write("|                            OPTIONS: Choose an option by entering its number                            |");
     WriteToConsole.Write("----------------------------------------------------------------------------------------------------------");
     WriteToConsole.Write("| 1 | View Calculation History (Entire List)");
     WriteToConsole.Write("| 2 | View/Modify Calculation History [NEXT, PREVIOUS, FIRST, LAST, CHANGE, REMOVE]");
     WriteToConsole.Write("| 3 | Create New Calculations");
     WriteToConsole.Write("| 4 | Display What The Calculator Is Capable Of Doing (In Its Current State)");
     WriteToConsole.Write("| 5 | Check State Of All Calculations");
     WriteToConsole.Write("| 6 | Exit Program");
     WriteToConsole.Write("----------------------------------------------------------------------------------------------------------\n");
 }
Exemplo n.º 7
0
 private static void ChangeConfiguration(Configuration config)
 {
     while (true)
     {
         WriteToConsole.Text("Current Settings:\n\t" + config.ToString());
         WriteToConsole.Text("Which Setting would you like to change?");
         WriteToConsole.Text("\t#Col:Green#1# : Check Interval\n\t#Col:Green#2# : Notify on finish\n\t#Col:Green#3# : Number of Notifications\n\t#Col:Green#4# : Back to Main Menu");
         string userInput = Console.ReadLine();
         if (userInput == "1")
         {
             Console.WriteLine("Please Enter the Number of Seconds:");
             try
             {
                 config.sleepTimerInSeconds = int.Parse(Console.ReadLine());
             }
             catch (FormatException ex)
             {
                 WriteToConsole.Error("Could not Read Input!");
                 continue;
             }
         }
         else if (userInput == "2")
         {
             config.notifyOnFinish = !config.notifyOnFinish;
         }
         else if (userInput == "3")
         {
             Console.WriteLine("Please Enter the Number of Notifications:");
             try
             {
                 config.numberOfNotifications = int.Parse(Console.ReadLine());
             }
             catch (FormatException ex)
             {
                 WriteToConsole.Error("Could not Read Input!");
                 continue;
             }
         }
         else if (userInput == "4")
         {
             config.Save();
             return;
         }
         else
         {
             WriteToConsole.Error("Could not Read Input!");;
             continue;
         }
         Console.Clear();
     }
 }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            WriteToConsole wtc = DescribeChild;

            wtc += DescribeParent;

            wtc(new Child {
                Name = "Jane Doe", Parent = new Parent {
                    Name = "John Doe"
                }
            });

            Console.ReadKey();
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            IWrite              writer         = new WriteToConsole();
            CheckCollision      checkcollision = new CheckCollision();
            ITrack              track          = new Track();
            ITrackParsing       parseTracks    = new TrackParsing(track);
            ICompareTracks      comparetracks  = new CompareTracks();
            IFilterFlightLimits filter         = new FilterFlightLimits();
            var myReceiver = TransponderReceiverFactory.CreateTransponderDataReceiver();


            var receiver = new MainReceiver(myReceiver, filter, writer, checkcollision, comparetracks, parseTracks);

            Console.ReadKey();
        }
        public static void DisplayOperations(ICalculatorComponent calculator, String options)
        {
            foreach (Invoker command in calculator.Commands)
            {
                string op = command.OperationString;

                while (op != "Final Command")
                {
                    options += command.OperationString;
                    options += ",";
                    op       = "Final Command";
                }
            }

            options = options.Replace(",", " | ");
            WriteToConsole.Write($"| {options}\n");
        }
Exemplo n.º 11
0
 public WinTunnel(String strListeningPort, string strForwardAddress, string strForwardPort, bool bHttpsClient, bool bHttpsServer,
     string strLogFileLocation, WriteToConsole delWriteToConsole, WriteToConsole delWriteToLog, bool bLogToFile,
     string strCertForClientConnection, string strClientConnectionCertPassword)
 {
     m_strListeningPort = strListeningPort;
     m_strForwardAddress = strForwardAddress;
     m_strForwardPort = strForwardPort;
     m_bHttpsClient = bHttpsClient;
     m_bHttpsServer = bHttpsServer;
     m_strLogFileLocation = strLogFileLocation;
     m_delWriteToConsole = delWriteToConsole;
     m_delWriteToLog = delWriteToLog;
     m_bLogToFile = bLogToFile;
     if (bHttpsClient)
     {
         CertificateForClientConnection = new X509Certificate2(strCertForClientConnection, strClientConnectionCertPassword);
     }
 }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            //1264x720
            while (Process.GetProcessesByName("SodaDungeon2").Length < 1)
            {
                WriteToConsole.Error("Could not detect the Game!");
                WriteToConsole.Text("Please make sure, that the game is running. Press Enter once you have started the game.");
                Console.ReadLine();
            }

            sodaGame = Process.GetProcessesByName("SodaDungeon2")[0].MainWindowHandle;
            Configuration config = new Configuration();

            config.Save();
            while (true)
            {
                WriteToConsole.Text("What would you like to Do? Type the coresponding Number.");
                string shutdownStatus = (shutDownOnFinish) ? "#Col:Green#Enabled#" : "#Col:Red#Disabled#";
                WriteToConsole.Text($"\t#Col:Green#1# : Start\n\t#Col:Green#2# : change your Configuration\n\t#Col:Green#3# : Change option 'Shutdown on finish' currently set to: {shutdownStatus}\n\t#Col:Green#4# : Exit");
                string userInput = Console.ReadLine();
                if (userInput == "1")
                {
                    RunTool(config);
                }
                else if (userInput == "2")
                {
                    ChangeConfiguration(config);
                }
                else if (userInput == "3")
                {
                    shutDownOnFinish = !shutDownOnFinish;
                }
                else if (userInput == "4")
                {
                    break;
                }
                else
                {
                    WriteToConsole.Error("Could not Read Input!");
                    continue;
                }
                Console.Clear();
            }
        }
        public void Next(ICalculatorComponent calculator)
        {
            Index += NextI;
            bool end = EndOfCollection();

            while (!end)
            {
                ShowSingle(Index, calculator);
                end = true;
            }

            end = EndOfCollection();
            while (end)
            {
                Index = CalculationHistory.Count - 1;
                WriteToConsole.Write("\nYou are at the end of the calculation history.");
                Last(calculator);
                end = false;
            }
        }
Exemplo n.º 14
0
        public void Start()
        {
            QuestionUser = ((x) => UserDialog?.Invoke(x));
            Write        = ((x, z) => WriteToConsole?.Invoke(x, z));
            WriteLine    = ((x, z) => WriteLineToConsole?.Invoke(x, z));

            ThreadPool.QueueUserWorkItem(obj =>
            {
                if (!FirstTimeSetup(QuestionUser))
                {
                    throw new Exception("First Time Params Not Set");
                }

                IRCClient.Start(HandleUserCommands, Twitch.TwitchAPI._channel);

                TwitchAPI.Init();
                VoteSystem.Init();
                UserManager.Init();
                IRCClient.Init(ConsoleWrite);
                MemorySystem._instance.Init();
                Microphone.Init();
            });
        }
Exemplo n.º 15
0
 public static void _Number()
 {
     WriteToConsole.Write("\nEnter number:");
 }
Exemplo n.º 16
0
 internal static void InitApp()
 {
     ShoppingCart.InitCart();
     WriteToConsole.WriteProducts(HandleJsonData.GetProducts());
     WriteToConsole.GetUserProduct();
 }
Exemplo n.º 17
0
 public static void Subtraction()
 {
     WriteToConsole.Write("\n\n- - - - - - - - - - - -");
     WriteToConsole.Write("YOU CHOSE: Subtraction");
     WriteToConsole.Write("- - - - - - - - - - - -\n");
 }
Exemplo n.º 18
0
 public static void Addition()
 {
     WriteToConsole.Write("\n\n- - - - - - - - - - -");
     WriteToConsole.Write("YOU CHOSE: Addition");
     WriteToConsole.Write("- - - - - - - - - - -\n");
 }
Exemplo n.º 19
0
 public static void Division()
 {
     WriteToConsole.Write("\n\n- - - - - - - - - - -");
     WriteToConsole.Write("YOU CHOSE: Division");
     WriteToConsole.Write("- - - - - - - - - - -\n");
 }
Exemplo n.º 20
0
 public static void Multiplication()
 {
     WriteToConsole.Write("\n\n- - - - - - - - - - - - - -");
     WriteToConsole.Write("YOU CHOSE: Multiplication");
     WriteToConsole.Write("- - - - - - - - - - - - - -\n");
 }
Exemplo n.º 21
0
 public static void Square()
 {
     WriteToConsole.Write("\n\n- - - - - - - - - -");
     WriteToConsole.Write("YOU CHOSE: Square");
     WriteToConsole.Write("- - - - - - - - - -\n");
 }
Exemplo n.º 22
0
 public static void Intro()
 {
     WriteToConsole.Write("------------------------");
     WriteToConsole.Write("| Calculator Activated |");
     WriteToConsole.Write("------------------------\n");
 }
 public void Start(string[] args)
 {
     WriteToConsole?.Invoke("Service has started");
 }
 public void Shutdown()
 {
     WriteToConsole?.Invoke("Service has been shutdown");
 }
 public void Pause()
 {
     WriteToConsole?.Invoke("Service has paused");
 }
 public void Stop()
 {
     WriteToConsole?.Invoke("Service has stopped");
 }
Exemplo n.º 27
0
 public static void _FirstNumber()
 {
     WriteToConsole.Write("\nEnter first number:");
 }
 public void Continue()
 {
     WriteToConsole?.Invoke("Service has continued");
 }
Exemplo n.º 29
0
 public static void _SecondNumber()
 {
     WriteToConsole.Write("\nEnter second number:");
 }
 public void CustomCommand(int command)
 {
     WriteToConsole?.Invoke("Service has gotten a custom command");
 }
Exemplo n.º 31
0
 public static void Zero()
 {
     WriteToConsole.Write("\nThis number cannot be 0.");
     WriteToConsole.Write("Please enter another number:");
 }