예제 #1
0
 public void Reload()
 {
     //DataContextが変更されたタイミングで呼び出される。
     //ここで状態を復元
     Reload(state);
     state = null;
 }
예제 #2
0
 public virtual void Complete(VMState state)
 {
     Action action = GetCompleteAction(state);
     if (action == null)
     {
         return;
     }
     using (UndoTransaction tx = new UndoTransaction(UndoManager, true))
     {
         action();
     }
 }
예제 #3
0
 protected override void Reload(VMState state)
 {
     rows.Clear();
     if (compareTable.IsCompareTypeConceptScheme)
     {
         ReloadForConceptScheme();
     } else if (compareTable.IsCompareTypeConcept)
     {
         ReloadForConcept();
     } else if (compareTable.IsCompareTypeVariable)
     {
         ReloadForVariable();
     }
 }
예제 #4
0
 protected virtual Action GetCompleteAction(VMState state)
 {
     return null;
 }
예제 #5
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedBookItem = EDOUtils.FindOrFirst(books, state.State1);
     }
 }
예제 #6
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     state.State1 = SelectedFundingInfo.Id;
     return state;
 }
예제 #7
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => {
         foreach (SamplingVM sampling in Samplings)
         {
             sampling.GenerateMember();
         }
     };
 }
예제 #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);
                }
            }
        }
예제 #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);
                }
            }
        }
예제 #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;
 }
예제 #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);
     }
 }
예제 #12
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     if (SelectedControlConstructScheme != null)
     {
         state.State1 = SelectedControlConstructScheme.Id;
     }
     return state;
 }
예제 #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);
     }
 }
예제 #14
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => { StudyUnit.CompleteVariables(); };
 }
예제 #15
0
 protected virtual void Reload(VMState state)
 {
 }
예제 #16
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => { StudyUnit.CompleteDataSets(); };
 }
예제 #17
0
 // メイン画面の書く入力フォームに対応したViewModel。
 // 親としてEDOUnitVMを継承した、StudyUnitVMか、GroupVMを想定。
 public FormVM(EDOUnitVM edoUnit)
     : base(edoUnit)
 {
     state = null;
 }
예제 #18
0
 public UndoInfo(EDOModel edoModel, VMState state)
 {
     this.edoModel = edoModel;
     this.state = state;
 }
예제 #19
0
 public void LoadState(VMState state)
 {
     //FormVMの場合Reloadで状態を戻すのでここで一旦保存しておく。
     this.state = state;
 }
예제 #20
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedCodeScheme = EDOUtils.Find(codeSchemes, state.State1);
     }
     if (SelectedCodeScheme == null)
     {
         SelectedCodeScheme = EDOUtils.GetFirst(codeSchemes);
     }
 }
예제 #21
0
 protected override Action GetCompleteAction(VMState state)
 {
     return () => { UpdateModel(); };
 }
예제 #22
0
 protected override void Reload(VMState state)
 {
     SelectedQuestionGroup = EDOUtils.FindOrFirst(questionGroups, state);
 }
예제 #23
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     state.State1 = SelectedSampling.Id;
     return state;
 }
예제 #24
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedDataFile = EDOUtils.Find(dataFiles, state.State1);
     }
     if (SelectedDataFile == null)
     {
         SelectedDataFile = EDOUtils.GetFirst(dataFiles);
     }
 }
예제 #25
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         selectedSamplingItem = EDOUtils.Find(Samplings, state.State1);
     }
     if (selectedSamplingItem == null)
     {
         selectedSamplingItem = EDOUtils.GetFirst(Samplings);
     }
 }
예제 #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;
         }
     }
 }
예제 #27
0
 protected override void Reload(VMState state)
 {
     if (state != null)
     {
         SelectedItem = EDOUtils.Find(fundingInfos, state.State1);
     }
     if (SelectedItem == null)
     {
         SelectedItem = EDOUtils.GetFirst(fundingInfos);
     }
 }
예제 #28
0
 public override VMState SaveState()
 {
     VMState state = new VMState();
     if (SelectedBook != null)
     {
         state.State1 = SelectedBook.Id;
     }
     return state;
 }