public void Run()
 {
     foreach (var index in _filter)
     {
         ref HelperComponent helper = ref _filter.Get1(index);
         helper.Angle -= helper.RotateSpeed * Time.deltaTime;
         var offset = new Vector3(Mathf.Sin(helper.Angle), Mathf.Cos(helper.Angle), 0) * helper.Radius;
         helper.Transform.position = helper.Center + offset;
     }
        /// <summary>
        /// Prints a console formatted message that notifies the utility launch
        /// if "withBaloon" is true it lanches also a Windows system notification
        /// </summary>
        /// <param name="withBaloon"></param>
        // TODO: Implement decorator pattern on this class to make it print 'Execution completed'
        protected void stopNotification(bool withBaloon = false)
        {
            HelperComponent.PrintColouredMessage("Concluded application " + getName(), ConsoleColor.DarkRed);

            if (withBaloon)
            {
                HelperComponent.ShowBalloon(getName(), "Stopped");
            }
        }
        /// <summary>
        /// Prints a console formatted message that notifies the utility launch
        /// if "withBaloon" is true it lanches also a Windows system notification
        /// </summary>
        /// <param name="withBaloon"></param>
        protected void startNotification(bool withBaloon = false)
        {
            HelperComponent.PrintColouredMessage("Launched utility " + getName(), ConsoleColor.DarkGreen);

            if (withBaloon)
            {
                HelperComponent.ShowBalloon(getName(), "Started");
            }
        }
Esempio n. 4
0
        public void StartProgramHub()
        {
            string userInput;

            do
            {
                userInput = Console.ReadLine();

                switch (userInput.ToLower().Trim())
                {
                case "msu -l":
                    HelperComponent.PrintUtilitiesList();
                    break;

                case "msu":
                    HelperComponent.PrintColouredMessage("Type the index of the utility that you want to start", ConsoleColor.White);
                    break;

                case "msu 0":
                    utilityFactory.createUtility("XboxControllerAsMouse").Start();
                    break;

                case "msu 1":
                    utilityFactory.createUtility("FolderReorganizer").Start();
                    break;

                case "msu -h":
                    HelperComponent.PrintCommandsList();
                    break;

                case "clear":
                    Console.Clear();
                    break;

                case "":
                    break;

                default:
                    HelperComponent.PrintColouredMessage("Command not found, type 'msu -h' to show the commands list", ConsoleColor.White);
                    break;
                }
            }while ((userInput != ":q" && userInput != "msu quit") || isUtilityRunning);
        }
Esempio n. 5
0
 public Program()
 {
     HelperComponent.PrintColouredMessage("Welcome to MSU App!\nType 'msu -h' to show the commands list, 'msu start {0}' " +
                                          "to start a utility or 'msu quit' to quit the app\n", ConsoleColor.Yellow, false);
     utilityFactory = new UtilityFactory();
 }