Beispiel #1
0
        public void AddConceptScheme()
        {
            ConceptSchemeVM conceptScheme = new ConceptSchemeVM();

            conceptScheme.OrderNo     = EDOUtils.GetMaxOrderNo <ConceptSchemeVM>(conceptSchemes) + 1;
            conceptScheme.OrderPrefix = PREFIX;
            conceptScheme.InitTitle();
            conceptSchemes.Add(conceptScheme);
            SelectedConceptScheme = conceptScheme;
            Memorize();
        }
 public ConceptFormVM(StudyUnitVM studyUnit)
     : base(studyUnit)
 {
     this.conceptSchemes = new ObservableCollection<ConceptSchemeVM>();
     int i = 1;
     foreach (ConceptScheme conceptSchemeModel in studyUnit.ConceptSchemeModels)
     {
         ConceptSchemeVM conceptScheme = new ConceptSchemeVM(conceptSchemeModel) {
             Parent = this,
             OrderNo = i++,
             OrderPrefix = PREFIX
         };
         conceptScheme.InitTitle();
         conceptSchemes.Add(conceptScheme);
     }
     modelSyncher = new ModelSyncher<ConceptSchemeVM, ConceptScheme>(this, conceptSchemes, studyUnit.ConceptSchemeModels);
     allConcepts = new ObservableCollection<ConceptVM>();
 }
Beispiel #3
0
        public ConceptFormVM(StudyUnitVM studyUnit) : base(studyUnit)
        {
            this.conceptSchemes = new ObservableCollection <ConceptSchemeVM>();
            int i = 1;

            foreach (ConceptScheme conceptSchemeModel in studyUnit.ConceptSchemeModels)
            {
                ConceptSchemeVM conceptScheme = new ConceptSchemeVM(conceptSchemeModel)
                {
                    Parent      = this,
                    OrderNo     = i++,
                    OrderPrefix = PREFIX
                };
                conceptScheme.InitTitle();
                conceptSchemes.Add(conceptScheme);
            }
            modelSyncher = new ModelSyncher <ConceptSchemeVM, ConceptScheme>(this, conceptSchemes, studyUnit.ConceptSchemeModels);
            allConcepts  = new ObservableCollection <ConceptVM>();
        }
Beispiel #4
0
 public bool CanRemoveConceptScheme(ConceptSchemeVM conceptScheme)
 {
     ObservableCollection<ConceptVM> concepts = conceptScheme.Concepts;
     foreach (ConceptVM concept in concepts)
     {
         if (!CanRemoveConcept(concept))
         {
             return false;
         }
     }
     return true;
 }
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedConceptScheme = EDOUtils.Find(conceptSchemes, state.State1);
     }
     if (SelectedConceptScheme == null)
     {
         SelectedConceptScheme = EDOUtils.GetFirst(conceptSchemes);
     }
 }
 public void RemoveConceptScheme()
 {
     List<ConceptVM> concepts = new List<ConceptVM>();
     concepts.AddRange(SelectedConceptScheme.Concepts);
     StudyUnit.OnRemoveConcepts(concepts);
     conceptSchemes.Remove(SelectedConceptScheme);
     SelectedConceptScheme = conceptSchemes.Last();
 }
 public void AddConceptScheme()
 {
     ConceptSchemeVM conceptScheme = new ConceptSchemeVM();
     conceptScheme.OrderNo = EDOUtils.GetMaxOrderNo<ConceptSchemeVM>(conceptSchemes) + 1;
     conceptScheme.OrderPrefix = PREFIX;
     conceptScheme.InitTitle();
     conceptSchemes.Add(conceptScheme);
     SelectedConceptScheme = conceptScheme;
     Memorize();
 }