public void TogglePinState(StateModel stateModel) { StateModel pinnedState = this.PinnedState; if (this.PinnedState != null) { this.ModelManager.UnpinState(this, this.PinnedState); } if (pinnedState == stateModel) { return; } this.ModelManager.PinState(this, stateModel); }
private void UpdateParkedTransitionsForState(StateModel model) { if (this.parkedTransitions == null) { return; } this.parkedTransitions.RemoveAll((Predicate <TransitionModel>)(transition => { if (!model.DoesTransitionMatch(transition)) { return(false); } model.AddTransitionModel(transition); return(true); })); }
public void RemoveStateModel(StateModel model) { if (this.states.Contains(model)) { this.states.Remove(model); foreach (TransitionModel transition in (Collection <TransitionModel>)model.Transitions) { this.ParkTransition(transition); transition.ParentModel = (ModelBase)null; } } foreach (StateModel stateModel in (Collection <StateModel>) this.StateModels) { stateModel.NotifyHasPotentialTransitionsChanged(); } }
public void AddStateModel(StateModel model) { List <string> predefinedNames = new List <string>(); if (ModelBase.stateAndStateGroupsPredefinedOrder.ContainsKey(this.Name)) { predefinedNames = ModelBase.stateAndStateGroupsPredefinedOrder[this.Name]; } this.states.Insert(ModelBase.GetInsertionIndex <StateModel>(model, (Collection <StateModel>) this.States, predefinedNames, (Microsoft.Expression.DesignSurface.ViewModel.SceneNode) this.SceneNode), model); model.ParentModel = (ModelBase)this; this.UpdateParkedTransitionsForState(model); foreach (StateModel stateModel in (Collection <StateModel>) this.StateModels) { stateModel.NotifyHasPotentialTransitionsChanged(); } }
private static SceneNode GetSceneNode(ModelBase item) { StateModel stateModel = item as StateModel; if (stateModel != null) { return((SceneNode)stateModel.SceneNode); } StateGroupModel stateGroupModel; if ((stateGroupModel = item as StateGroupModel) != null) { return((SceneNode)stateGroupModel.SceneNode); } return((SceneNode)null); }
public void RemoveTransitionModel(TransitionModel model) { StateModel stateModel = model.StateModel; if (stateModel != null) { stateModel.RemoveTransitionModel(model); model.ParentModel = (ModelBase)null; model.GroupModel = (StateGroupModel)null; } else { this.parkedTransitions.Remove(model); } if (model.GroupModel == null || model != model.GroupModel.DefaultTransition || model.TransitionSceneNode != null && model.TransitionSceneNode.ShouldSerialize && model.TransitionSceneNode.IsAttached) { return; } TransitionModel transitionModel = this.parkedTransitions.Find((Predicate <TransitionModel>)(transition => { if (string.IsNullOrEmpty(transition.FromStateName)) { return(string.IsNullOrEmpty(transition.ToStateName)); } return(false); })); if (transitionModel == null) { this.DefaultTransition = new TransitionModel((VisualStateTransitionSceneNode)null, this); this.parkedTransitions.Add(this.DefaultTransition); } else { this.DefaultTransition = transitionModel; } this.NotifyPropertyChanged("DefaultTransition"); }
public void SelectState(StateModel stateModel) { this.ModelManager.SelectState(this, stateModel); }
public PotentialTransitionModel(StateModel fromModel, StateModel toModel) { this.fromModel = fromModel; this.toModel = toModel; }