public virtual void OpenCompetition(TA.Corel.Competition competition)
 {
     FCompetition = competition;
     CreateGrid();
     UpdatePicture();
     UpdateButtonsActivity();
 }
Ejemplo n.º 2
0
 public OlympicParamsPanel(TA.Corel.Competition aCompetition)
     : base(aCompetition)
 {
     InitializeComponent();
     LocalizeComponents();
     ReadParameters();
 }
 public static CompetitionController GetController(TA.Corel.Competition competition)
 {
     //Нужно следить за порядком сравнения типов, из-за возможного наследования
     // сначала проверяем потомков, а потом остальные
     if (competition.GetType() == typeof(RobinOlympic))
     {
         RobinOlympicController ctrl = new RobinOlympicController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(OlympicConsolation))
     {
         OlympicConsolationController ctrl = new OlympicConsolationController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(OlympicDE))
     {
         CompetitionController ctrl = new OlympicDEController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(Olympic))
     {
         CompetitionController ctrl = new OlympicController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(FppSwiss))
     {
         FppsSwissController ctrl = new FppsSwissController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(Swiss))
     {
         SwissController ctrl = new SwissController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(Robin))
     {
         RobinController ctrl = new RobinController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     if (competition.GetType() == typeof(Swing))
     {
         SwingController ctrl = new SwingController();
         ctrl.Competition = competition;
         return(ctrl);
     }
     throw new Exception("Unknown Competition Controller");
 }
 public override void OpenCompetition(TA.Corel.Competition competition)
 {
     if (competition.Players.Count > 1)
     {
         competition.Info.Properties["PRIZE_COUNT"] = (competition.Players.Count).ToString();
     }
     else
     {
         competition.Info.Properties["PRIZE_COUNT"] = "1";
     }
     base.OpenCompetition(competition);
     SetRebuyColumnsVisibility((Competition as FppSwiss).AllowRebuy);
 }
Ejemplo n.º 5
0
        public override void OpenCompetition(TA.Corel.Competition competition)
        {
            base.OpenCompetition(competition);
            int player_count = competition.Players.Count;

            if (player_count < 2)
            {
                player_count = 1;
            }
            ibxPrizeCount.MaximumValue = player_count;
            //btnCancelRound.Visible = false;
            ibxPrizeCount.Value = Math.Min(Competition.Info.Properties.GetInt32Value("PRIZE_COUNT", 1), ibxPrizeCount.MaximumValue);
            int round_count = MaxRoundCount;

            if (round_count > 0)
            {
                lblRoundCount.Text = String.Format(Localizator.Dictionary.GetString("RECOMMENDED_ROUNDS_INT"), round_count);
            }
            else
            {
                lblRoundCount.Text = String.Format(Localizator.Dictionary.GetString("RECOMMENDED_ROUNDS"));
            }
        }