public void UpdateAction(ActionViewModel callActionViewModel)
 {
     if (ActionViewModels.Count != Actions.Count || !ActionViewModels.Contains(callActionViewModel)) return;
     int index = ActionViewModels.IndexOf(callActionViewModel);
     RenameSimilarActs(callActionViewModel);
     Actions[index].Name = callActionViewModel.EditableAction.Name;
 }
        void RenameSimilarActs(ActionViewModel callActionViewModel)
        {
            var simactslist = SearchSimilarActs(callActionViewModel.Name.Trim()).ToList();

            foreach (var action in simactslist)
            {
                string name = callActionViewModel.Name;
                ActionViewModels[Actions.IndexOf(action)].Name = name + "*";
                action.Name = name + "*";
            }
        }
        public void UpdateAction(ActionViewModel callActionViewModel)
        {
            if (ActionViewModels.Count != Actions.Count || !ActionViewModels.Contains(callActionViewModel))
            {
                return;
            }
            int index = ActionViewModels.IndexOf(callActionViewModel);

            RenameSimilarActs(callActionViewModel);
            Actions[index].Name = callActionViewModel.EditableAction.Name;
        }
 private int FindIndexInActionViewModels(ActionViewModel element)
 {
     for (int i = 0; i < ActionViewModels.Count; i++)
     {
         if (ActionViewModels[i] == element)
         {
             return(i);
         }
     }
     return(OUT_OF_RANGE);
 }
Пример #5
0
 protected virtual void InitViewModels()
 {
     ActionsViewModel = new ActionsViewModel(BaseLayer, ActionErrorCatcher);
     ActionViewModel = new ActionViewModel(CreateActionTemplate(), ActionsViewModel, ActionErrorCatcher);
     EventsViewModel = new EventsViewModel(BaseLayer, EventErrorCatcher);
     EventViewModel = new EventViewModel(CreateEventTemplate(), EventsViewModel, EventErrorCatcher);
     TaskParamsViewModel = new TaskParamsViewModel(BaseLayer, TaskParamErrorCatcher);
     EventsDepActionsViewModel = new EventsDepActionsViewModel(BaseLayer, EventErrorCatcher);
     EventDepActionViewModel = new EventDepActionViewModel(BaseLayer, CreateEventTemplate(), EventsDepActionsViewModel, EventErrorCatcher);
 }
 private int FindIndexInActionViewModels(ActionViewModel element)
 {
     for (int i = 0; i < ActionViewModels.Count; i++)
         if (ActionViewModels[i] == element)
             return i;
     return OUT_OF_RANGE;
 }
 void RenameSimilarActs(ActionViewModel callActionViewModel)
 {
     var simactslist = SearchSimilarActs(callActionViewModel.Name.Trim()).ToList();
     foreach (var action in simactslist)
     {
         string name = callActionViewModel.Name;
         ActionViewModels[Actions.IndexOf(action)].Name = name + "*";
         action.Name = name + "*";
     }
 }