Пример #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);
        }
Пример #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);
        }
Пример #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;
         }
     }
 }
Пример #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);
        }
Пример #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;
            }
        }
Пример #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;
 }
Пример #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;
 }
Пример #8
0
 void MenuHandicapTeamClick(object sender, EventArgs e)
 {
     Handicap.Value = InputDialog.GetDouble("Handicap", "Set team handicap (" + League.HandicapStyle.ToString() + ")", Handicap.Value);
     Recalculate(false);
 }
Пример #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);
 }
Пример #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);
        }