예제 #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);
        }