Esempio n. 1
0
 public void Reload()
 {
     //DataContextが変更されたタイミングで呼び出される。
     //ここで状態を復元
     Reload(state);
     state = null;
 }
Esempio n. 2
0
 public virtual void Complete(VMState state)
 {
     Action action = GetCompleteAction(state);
     if (action == null)
     {
         return;
     }
     using (UndoTransaction tx = new UndoTransaction(UndoManager, true))
     {
         action();
     }
 }
Esempio n. 3
0
 protected override void Reload(VMState state)
 {
     rows.Clear();
     if (compareTable.IsCompareTypeConceptScheme)
     {
         ReloadForConceptScheme();
     } else if (compareTable.IsCompareTypeConcept)
     {
         ReloadForConcept();
     } else if (compareTable.IsCompareTypeVariable)
     {
         ReloadForVariable();
     }
 }
Esempio n. 4
0
 protected virtual Action GetCompleteAction(VMState state)
 {
     return null;
 }
Esempio n. 5
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedBookItem = EDOUtils.FindOrFirst(books, state.State1);
     }
 }
 public override VMState SaveState()
 {
     VMState state = new VMState();
     state.State1 = SelectedFundingInfo.Id;
     return state;
 }
Esempio n. 7
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => {
         foreach (SamplingVM sampling in Samplings)
         {
             sampling.GenerateMember();
         }
     };
 }
Esempio n. 8
0
        public void Complete(VMState state)
        {
            int id = (int)state.State1;
            VMState childState = (VMState)state.State2;

            List<MenuItemVM> allMenuItems = AllMenuItems;
            foreach (MenuItemVM menuItem in allMenuItems)
            {
                if (menuItem.Id == id)
                {
                    menuItem.Content.Complete(childState);
                }
            }
        }
Esempio n. 9
0
        public void LoadState(VMState state)
        {
            int id = (int)state.State1;
            VMState childState = (VMState)state.State2;

            List<MenuItemVM> allMenuItems = AllMenuItems;
            foreach (MenuItemVM menuItem in allMenuItems)
            {
                menuItem.IsSelected = false;
                if (menuItem.Id == id)
                {
                    menuItem.IsSelected = true;
                    menuItem.Content.LoadState(childState);
                }
            }
        }
Esempio n. 10
0
 public override VMState SaveState()
 {
     if (SelectedConcept == null)
     {
         //ありえないかもしれないが一応チェックが必要?
         return null;
     }
     VMState state = new VMState();
     state.State1 = SelectedConcept.Id;
     if (SelectedQuestion != null)
     {
         state.State2 = SelectedQuestion.Id;
         ResponseVM response = SelectedQuestion.Response;
         state.State3 = response.SelectedIndex;
     }
     return state;
 }
Esempio n. 11
0
 protected override void Reload(VMState state)
 {
     UpdateConcepts();
     if (state != null)
     {
         SelectedConcept = EDOUtils.Find(Concepts, state.State1);
         if (SelectedConcept != null)
         {
             SelectedQuestionItem = EDOUtils.Find(SelectedQuestions, state.State2);
             if (selectedQuestionItem != null)
             {
                 SelectedQuestion.Response.SelectedIndex = Convert.ToInt32(state.State3);
             }
         }
     }
     if (SelectedConcept == null)
     {
         SelectedConcept = EDOUtils.GetFirst<ConceptVM>(Concepts);
     }
 }
Esempio n. 12
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     if (SelectedControlConstructScheme != null)
     {
         state.State1 = SelectedControlConstructScheme.Id;
     }
     return state;
 }
Esempio n. 13
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedVariableItem = EDOUtils.Find(variables, state.State1);
     }
     if (SelectedVariableItem == null)
     {
         SelectedVariableItem = EDOUtils.GetFirst<VariableVM>(variables);
     }
 }
Esempio n. 14
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => { StudyUnit.CompleteVariables(); };
 }
Esempio n. 15
0
 protected virtual void Reload(VMState state)
 {
 }
Esempio n. 16
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => { StudyUnit.CompleteDataSets(); };
 }
Esempio n. 17
0
 // メイン画面の書く入力フォームに対応したViewModel。
 // 親としてEDOUnitVMを継承した、StudyUnitVMか、GroupVMを想定。
 public FormVM(EDOUnitVM edoUnit)
     : base(edoUnit)
 {
     state = null;
 }
Esempio n. 18
0
 public UndoInfo(EDOModel edoModel, VMState state)
 {
     this.edoModel = edoModel;
     this.state = state;
 }
Esempio n. 19
0
 public void LoadState(VMState state)
 {
     //FormVMの場合Reloadで状態を戻すのでここで一旦保存しておく。
     this.state = state;
 }
Esempio n. 20
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedCodeScheme = EDOUtils.Find(codeSchemes, state.State1);
     }
     if (SelectedCodeScheme == null)
     {
         SelectedCodeScheme = EDOUtils.GetFirst(codeSchemes);
     }
 }
Esempio n. 21
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => { UpdateModel(); };
 }
 protected override void Reload(VMState state)
 {
     SelectedQuestionGroup = EDOUtils.FindOrFirst(questionGroups, state);
 }
Esempio n. 23
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     state.State1 = SelectedSampling.Id;
     return state;
 }
Esempio n. 24
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedDataFile = EDOUtils.Find(dataFiles, state.State1);
     }
     if (SelectedDataFile == null)
     {
         SelectedDataFile = EDOUtils.GetFirst(dataFiles);
     }
 }
Esempio n. 25
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         selectedSamplingItem = EDOUtils.Find(Samplings, state.State1);
     }
     if (selectedSamplingItem == null)
     {
         selectedSamplingItem = EDOUtils.GetFirst(Samplings);
     }
 }
Esempio n. 26
0
 public void Complete(VMState state) 
 {
     string edoUnitId = (string)state.State1;
     VMState childState = (VMState)state.State2;
     foreach (EDOUnitVM edoUnit in edoUnits)
     {
         if (edoUnit.Id == edoUnitId)
         {
             SelectedItem.Complete(childState);
             break;
         }
     }
 }
Esempio n. 27
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedItem = EDOUtils.Find(fundingInfos, state.State1);
     }
     if (SelectedItem == null)
     {
         SelectedItem = EDOUtils.GetFirst(fundingInfos);
     }
 }
Esempio n. 28
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     if (SelectedBook != null)
     {
         state.State1 = SelectedBook.Id;
     }
     return state;
 }