Exemplo n.º 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();
        }
Exemplo n.º 2
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>();
 }
Exemplo n.º 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>();
        }
Exemplo n.º 4
0
 public bool CanRemoveConceptScheme(ConceptSchemeVM conceptScheme)
 {
     ObservableCollection<ConceptVM> concepts = conceptScheme.Concepts;
     foreach (ConceptVM concept in concepts)
     {
         if (!CanRemoveConcept(concept))
         {
             return false;
         }
     }
     return true;
 }
Exemplo n.º 5
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedConceptScheme = EDOUtils.Find(conceptSchemes, state.State1);
     }
     if (SelectedConceptScheme == null)
     {
         SelectedConceptScheme = EDOUtils.GetFirst(conceptSchemes);
     }
 }
Exemplo n.º 6
0
 public void RemoveConceptScheme()
 {
     List<ConceptVM> concepts = new List<ConceptVM>();
     concepts.AddRange(SelectedConceptScheme.Concepts);
     StudyUnit.OnRemoveConcepts(concepts);
     conceptSchemes.Remove(SelectedConceptScheme);
     SelectedConceptScheme = conceptSchemes.Last();
 }
Exemplo n.º 7
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();
 }