Example #1
0
        public static void Action(string file2, IncreaseAction mode = IncreaseAction.Nothing, string file1 = "")
        {
            Console.WriteLine($"Destination file will be {mode.ToString()}!");
            switch (mode)
            {
            case IncreaseAction.Delete:
                File.Delete(file2);
                break;

            case IncreaseAction.Copy:
                if (File.Exists(file1) && file2.Length != 0)
                {
                    File.Copy(file1, file2);
                }
                else
                {
                    Console.WriteLine("Error copying file! Check path or name of second file");
                }
                break;

            case IncreaseAction.Nothing:
                Console.WriteLine("Nothing will be done...");
                break;
            }
        }
Example #2
0
        private void DrawMulButtons()
        {
            Rect menuBg = ParentMenu.GetRect();
            int  btnY   = 5 + 45 * Position;

            if (GUI.Button(new Rect(menuBg.x + ParentMenu.GetWidthSize() - 80, menuBg.y + btnY, 40, 40), "-", Styles.OffStyle))
            {
                DecreaseAction?.Invoke();
                Draw();
            }
            if (GUI.Button(new Rect(menuBg.x + ParentMenu.GetWidthSize() - 35, menuBg.y + btnY, 40, 40), "+", Styles.OffStyle))
            {
                IncreaseAction?.Invoke();
                Draw();
            }
        }