public PlaybookRootViewModel(string userFolder, ViewMode viewMode)
        {
            ViewMode = viewMode;

            if (ViewMode == ViewMode.PlayNameView)
            {
                playTypes.Clear();

                PlayTypeViewModel ptvm = new PlayTypeViewModel(new PlayTypeDirectory(Enum.GetName(typeof(Webb.Playbook.Data.PlayTypes), Webb.Playbook.Data.PlayTypes.Run), userFolder));
                ptvm.IsExpanded = true;
                playTypes.Add(ptvm);
                //foreach (string strPlayType in Enum.GetNames(typeof(PlayTypes)))
                //{
                //    PlayTypeViewModel ptvm = new PlayTypeViewModel(new PlayTypeDirectory(strPlayType));
                //    ptvm.IsExpanded = true;
                //    playTypes.Add(ptvm);
                //}
            }

            if (ViewMode == ViewMode.FormationNameView)
            {
                scoutTypes.Clear();

                foreach (string strScoutType in Enum.GetNames(typeof(ScoutTypes)))
                {
                    ScoutTypeViewModel stvm = new ScoutTypeViewModel(new ScoutTypeDirectory(strScoutType, (int)Mode.Playbook, userFolder));
                    stvm.IsExpanded = true;
                    scoutTypes.Add(stvm);
                }
            }
        }
Example #2
0
        public PersonnelViewModel(Personnel personnel, ScoutTypeViewModel stv)
            : base(stv, true)
        {
            this.personnel = personnel;

            // sorting
            System.ComponentModel.ICollectionView view = System.Windows.Data.CollectionViewSource.GetDefaultView(Children);
            view.SortDescriptions.Add(new System.ComponentModel.SortDescription("FormationName", System.ComponentModel.ListSortDirection.Ascending));
        }
        public void Refresh(string userFolder)
        {
            ScoutTypes.Clear();

            foreach (string strScoutType in Enum.GetNames(typeof(ScoutTypes)))
            {
                ScoutTypeViewModel stv = new ScoutTypeViewModel(new ScoutTypeDirectory(strScoutType, (int)Mode.Formation, userFolder));
                stv.IsExpanded = true;
                ScoutTypes.Add(stv);
            }
        }
        public AdjustmentRootViewModel(string userFolder)
        {
            scoutTypes = new List <ScoutTypeViewModel>();

            foreach (string strScoutType in Enum.GetNames(typeof(ScoutTypes)))
            {
                ScoutTypeViewModel stvm = new ScoutTypeViewModel(new ScoutTypeDirectory(strScoutType, (int)Mode.Adjustment, userFolder));
                stvm.IsExpanded = true;
                scoutTypes.Add(stvm);
            }
        }
Example #5
0
 private void btnObject_Click(object sender, RoutedEventArgs e)
 {
     ViewModel.FormationViewModel formationViewModel = this.treeFormation.SelectedItem as ViewModel.FormationViewModel;
     if (formationViewModel != null)
     {
         ViewModel.ScoutTypeViewModel scoutTypeViewModel = formationViewModel.Parent.Parent as ViewModel.ScoutTypeViewModel;
         if (scoutTypeViewModel != null)
         {
             if (scoutTypeViewModel.ScoutType.ScoutType == Data.ScoutTypes.Offensive)
             {
                 playViewModel.ObjFormation = formationViewModel;
             }
         }
     }
 }
Example #6
0
        public FVFormationViewModel(FVFormationModel fVFFormation, ScoutTypeViewModel stvm)
            : base(stvm, false)
        {
            FVFFormation = fVFFormation;

            if (stvm.ScoutType.ScoutType == ScoutTypes.Offensive)
            {
                this.Image = AppDomain.CurrentDomain.BaseDirectory + @"Resource\Off Formation.ico";
            }

            if (stvm.ScoutType.ScoutType == ScoutTypes.Defensive)
            {
                this.Image = AppDomain.CurrentDomain.BaseDirectory + @"Resource\Def Formation.ico";
            }

            this.formationName = FVFFormation.FormationName;
        }