public void UpdateAction(ActionWithExtensionViewModel 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(ActionWithExtensionViewModel 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(ActionWithExtensionViewModel 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(ActionWithExtensionViewModel element) { for (int i = 0; i < ActionViewModels.Count; i++) { if (ActionViewModels[i] == element) { return(i); } } return(OUT_OF_RANGE); }
protected override void InitViewModels() { base.InitViewModels(); ActionsWithExtensionsViewModel = new ActionsWithExtensionsViewModel(BaseLayer, ActionErrorCatcher); ActionWithExtensionViewModel = new ActionWithExtensionViewModel(CreateActionTemplate(), ActionsWithExtensionsViewModel, ActionErrorCatcher); EventsWithExtensionsViewModel = new EventsWithExtensionsViewModel(BaseLayer, EventErrorCatcher); EventWithExtensionViewModel = new EventWithExtensionViewModel(CreateEventTemplate(), EventsWithExtensionsViewModel, EventErrorCatcher); }
void RenameSimilarActs(ActionWithExtensionViewModel 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 + "*"; } }
private int FindIndexInActionViewModels(ActionWithExtensionViewModel element) { for (int i = 0; i < ActionViewModels.Count; i++) if (ActionViewModels[i] == element) return i; return OUT_OF_RANGE; }