예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Test App");

            Console.WriteLine();
            Console.WriteLine();

            for (var i = 0; i < 2; i++ )
                Console.WriteLine(i.ToString());

            Console.WriteLine("Loading Alert Message");
            Console.ReadLine();

            WindowManager.SetupWindow();
            new Alert("This is an alert!", null);
            WindowManager.EndWindow();
            Console.WriteLine("That was the Alert");

            Console.WriteLine("Loading Confirm Message");
            Console.ReadLine();

            WindowManager.SetupWindow();
            var confirm = new Confirm(null, "Are you wish to run this program?");
            WindowManager.EndWindow();

            if (confirm.Result)
                Console.WriteLine("You pressed OK");
            else
                Console.WriteLine("You pressed Cancel");

            Console.ReadLine();
        }
예제 #2
0
        public void NewFile(Window parent)
        {
            if (FileInfo.HasChanged)
            {
                var saveCheck = new Confirm(parent, "You have unsaved changes! Do you wish to save?", "Save");
                if (saveCheck.Result) //User wishs to save
                {
                    if (!SaveData(parent)) //Save was cancelled
                        return;
                }
            }

            FileInfo.Filename = "Untitled.txt";
            FileInfo.HasChanged = false;

            textArea.SetText("");
            fileLabel.SetText(FileInfo.Filename);

            parent.ExitWindow();
            SelectItemByID("textArea");

            Draw();
        }
예제 #3
0
        private void ExitApp(Window parent)
        {
            if (FileInfo.HasChanged)
            {
                var saveCheck = new Confirm(parent, "You have unsaved changes! Do you wish to save?", "Save");
                if (saveCheck.Result) //User wishs to save
                {
                    if (!SaveData(parent)) //Save was cancelled
                        return;
                }
            }

            var exitCheck = new Confirm(parent, "Are you sure you wish to Exit?", "Exit");
            if (!exitCheck.Result)
                return;

            ProgramInfo.ExitProgram = true;
        }