Exemplo n.º 1
0
        } = 30;                                     //not const because can be changed with height or server length in future
        private ScreenController()
        {
            Task <Setting> settingTask = MainController.ReadFile();

            Server        = new InputText("Server", 3, 20, 5, InputLength);
            Port          = new InputNumber("Port", 3, 20, 7, InputLength);
            Nickname      = new InputText("Nickname", 3, 20, 9, InputLength);
            AltNickname   = new InputText("Alternative Nick", 3, 20, 11, InputLength);
            CommandPrefix = new InputChar("Command Prefix", 3, 20, 13);
            //new InputChar("PrivMsg Prefix", 30, 49, 13);
            User     = new InputText("User", 3, 20, 15, InputLength);
            AutoJoin = new ListInput("Autojoin channel", 3, 20, 17, InputLength);
            new InputButton("Connect", 12, 23, 11, Send);
            new InputButton("Cancel", 30, 23, 10, Exit);

            //Note: Call Load After Every Field was made
            settingTask.ContinueWith((configTask) => {
                if (configTask.IsCanceled || configTask.IsFaulted)
                {
                    Console.Clear();
                    Console.WriteLine("Failed to load setting files.");
                    Environment.Exit(-1);
                }
                setting = configTask.Result;
                LoadConfig(setting);
            });
            //"validation checkable" input fields.
            InputFields = new InputText[] { Port, Nickname, AltNickname, User, CommandPrefix, AutoJoin.TextField };
            screen.Start();
        }
Exemplo n.º 2
0
 internal ListValue(ListInput parent, string value, int x, int y)
 {
     this.parent = parent;
     Value       = value;
     X           = x;
     Y           = y;
     Render();
     parent.TextField.Clear();
     Screen.SelectBefore();
 }