private void NewStateMachine()
        {
            try
            {
                var textEditService = new TextEditService();

                string initialName = StateMachines
                                     .Select(sm => sm.Name)
                                     .CreateUniqueName("State Machine {0}");

                textEditService.EditText(initialName, "State Machine Name", "Create State Machine", name =>
                {
                    var model = new StateMachine()
                    {
                        Name    = name,
                        Actions = new StateMachineOutputAction[] { },
                        Inputs  = new StateMachineInput[] { }
                    };

                    var viewService = ApplicationContainer.Container.Resolve <IViewService>();

                    var viewModel = new StateMachineReferenceViewModel(model, viewService, DirtyService, _messageBoxService);

                    StateMachines.Add(viewModel);

                    _dirtyService.MarkDirty();
                });
            }
            catch (Exception ex)
            {
                _messageBoxService.Show(ex);
            }
        }
 public StateMachineProject GetModel()
 {
     _project.StateMachines     = StateMachines.Select(vm => vm.GetModel()).ToArray();
     _project.GenerationOptions = GenerationOptions.GetModel();
     return(_project);
 }