示例#1
0
        /// <summary>
        /// Initialises a new instance of the <see cref="AthleteConfigurationViewModel"/> class.
        /// </summary>
        /// <param name="model">handicap model</param>
        /// <param name="seriesConfigManager">series configutation manager</param>
        public AthleteConfigurationViewModel(
            IModel model,
            ISeriesConfigMngr seriesConfigManager)
        {
            this.model                     = model;
            this.athleteCollection         = new ObservableCollection <AthleteType>();
            this.changePredeclaredHandicap = string.Empty;

            this.numberPrefix = seriesConfigManager.ReadNumberPrefix();
            LoadAthleteInformation();

            ClubCollection.Add(new ClubType()
            {
                Club = string.Empty
            });

            // Order clubs alphabetically.
            List <string> clubs = model.GetClubList().OrderBy(club => club).ToList();

            foreach (string club in clubs)
            {
                ClubCollection.Add(new ClubType()
                {
                    Club = club
                });
            }

            this.newRaceNumber = this.NextRunningNumber;
            this.addRaceNumber = this.NextRunningNumber;

            // Search parameters
            this.searchString = string.Empty;
            this.surnameLetterSelectorCollection = new List <string>()
            {
                "", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "X", "Y", "Z"
            };
            this.surnameSelectorIndex = 0;

            AthleteAddNumberCommand = new AthleteConfigAddNumberCmd(this);
            //AthleteChangeCommand    = new AthleteConfigChangeCmd(this);
            this.AthleteChangeCommand =
                new SimpleCommand(
                    this.ChangeAthlete,
                    this.CanChange);
            //AthleteDeleteCommand    = new AthleteConfigDeleteCmd(this);
            this.AthleteDeleteCommand =
                new SimpleCommand(
                    this.DeleteAthlete,
                    this.CanDelete);
            this.AthleteNewCommand =
                new SimpleCommand(
                    this.AddNewAthlete,
                    this.CanAdd);
            //AthleteNewCommand       = new AthleteConfigNewCmd(this);
            //AthleteSaveCommand      = new AthleteConfigSaveCmd(this);
            this.AthleteSaveCommand =
                new SimpleCommand(
                    this.SaveAthletes,
                    this.CanSave);
        }
示例#2
0
 public IFFFile(string filename)
 {
     FileName            = filename;
     Part                = new PartCollection();
     Card                = new CardCollection();
     Caddie              = new CaddieCollection();
     Item                = new ItemCollection();
     LevelUpPrizeItem    = new LevelUpPrizeItemCollection();
     Character           = new CharacterCollection();
     Ball                = new BallCollection();
     Ability             = new AbilityCollection();
     Skin                = new SkinCollection();
     CaddieItem          = new CaddieItemCollection();
     Club                = new ClubCollection();
     ClubSet             = new ClubSetCollection();
     Course              = new CourseCollection();
     CutinInformation    = new CutinInformationCollection();
     Desc                = new DescCollection();
     Furniture           = new FurnitureCollection();
     FurnitureAbility    = new FurnitureAbilityCollection();
     Mascot              = new MascotCollection();
     TikiSpecialTable    = new TikiSpecialTableCollection();
     TikiRecipe          = new TikiRecipeCollection();
     TikiPointTable      = new TikiPointTableCollection();
     CadieMagicBox       = new CadieMagicBoxCollection();
     CadieMagicBoxRandom = new CadieMagicBoxRandomCollection();
     HairStyle           = new HairStyleCollection();
     Match               = new MatchCollection();
     SetItem             = new SetItemCollection();
     Enchant             = new EnchantCollection();
     Achievement         = new AchievementCollection();
     AuxPart             = new AuxPartCollection();
 }
示例#3
0
 /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
 /// <name>AddNewClub</name>
 /// <date>24/02/15</date>
 /// <summary>
 /// Adds a new club and resets the NewClub property.
 /// </summary>
 /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
 public void AddNewClub()
 {
     ClubCollection.Add(new ClubType()
     {
         Club = NewClub, Status = StatusType.Added
     });
     NewClub = string.Empty;
     saved   = false;
 }
示例#4
0
        /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
        /// <name>DeleteClub</name>
        /// <date>01/03/15</date>
        /// <summary>
        /// Removes the selected club and resets the index.
        /// </summary>
        /// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
        public void DeleteClub()
        {
            if (ClubCollection[SelectedClubIndex].Status == StatusType.Added)
            {
                ClubCollection.RemoveAt(SelectedClubIndex);
            }
            else
            {
                ClubCollection[SelectedClubIndex].Status = StatusType.Deleted;
            }

            ResetSelectedIndex();
            saved = false;
        }