Ejemplo n.º 1
0
        void MenuAdjustTeamScoreClick(object sender, EventArgs e)
        {
            double a = GameTeam.Adjustment == 0 ? -1000 : GameTeam.Adjustment;

            if (InputDialog.GetDouble("Adjustment", "Set team score adjustment", ref a))
            {
                GameTeam.Adjustment = a;
            }
            Recalculate(false);
        }
Ejemplo n.º 2
0
        public static Boolean UpdateInput(string title, string message, ref string response)
        {
            var     id = new InputDialog(title, message, response);
            Boolean b  = (id.ShowDialog() == DialogResult.OK);

            if (b)
            {
                response = id.Response;
            }
            return(b);
        }
Ejemplo n.º 3
0
 void ButtonRenameTeamClick(object sender, EventArgs e)
 {
     if (treeView1.SelectedNode.Tag is LeagueTeam)
     {
         string name = ((LeagueTeam)treeView1.SelectedNode.Tag).Name;
         if (InputDialog.UpdateInput("Rename Team", "Choose a new name for the team", ref name))
         {
             ((LeagueTeam)treeView1.SelectedNode.Tag).Name = name;
             treeView1.SelectedNode.Text = name;
         }
     }
 }
Ejemplo n.º 4
0
        public static bool GetDouble(string title, string message, ref double response)
        {
            var id = new InputDialog(title, message);

            id.SetNumeric((decimal)response);
            Boolean b = (id.ShowDialog() == DialogResult.OK);

            if (b)
            {
                response = (int)id.numericUpDown1.Value;
            }
            return(b);
        }
Ejemplo n.º 5
0
        void ButtonAddTeamClick(object sender, EventArgs e)
        {
            string name = null;

            if (InputDialog.ConditionalInput("Add Team", "Choose a name for the new team", ref name))
            {
                var team = new LeagueTeam();
                team.Name = name;
                League.AddTeam(team);

                var node = new TreeNode(name);
                node.Tag = team;
                treeView1.Nodes.Add(node);
                treeView1.SelectedNode = node;
            }
        }
Ejemplo n.º 6
0
 void ButtonRenameLeagueClick(object sender, EventArgs e)
 {
     League.Title = InputDialog.GetInput("Rename League", "Choose a new name for the league", League.Title);
     Text         = "Torn -- " + League.Title;
 }
Ejemplo n.º 7
0
 void MenuNameTeamClick(object sender, EventArgs e)
 {
     LeagueTeam.Name          = InputDialog.GetInput("Name: ", "Set a team name", LeagueTeam.Name);
     ListView.Columns[1].Text = LeagueTeam == null ? "Players" : LeagueTeam.Name;
 }
Ejemplo n.º 8
0
 void MenuHandicapTeamClick(object sender, EventArgs e)
 {
     Handicap.Value = InputDialog.GetDouble("Handicap", "Set team handicap (" + League.HandicapStyle.ToString() + ")", Handicap.Value);
     Recalculate(false);
 }
Ejemplo n.º 9
0
 void MenuAdjustVictoryPointsClick(object sender, EventArgs e)
 {
     GameTeam.PointsAdjustment = (double)InputDialog.GetDouble("Victory Points Adjustment", "Set team victory points adjustment", GameTeam.PointsAdjustment);
     Recalculate(false);
 }
Ejemplo n.º 10
0
        public static string GetInput(string title, string message, string defaultResponse = "")
        {
            var id = new InputDialog(title, message, defaultResponse);

            return(id.ShowDialog() == DialogResult.OK ? id.Response : defaultResponse);
        }