Пример #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;
 }