Exemplo n.º 1
0
        /// <summary>
        /// Create a new domain.
        /// </summary>
        private void AddDomainAction()
        {
            var domainEditorViewModel = new SharedDomainEditorViewModel();
            var x = this.windowManager.ShowDialog(domainEditorViewModel);

            if (!x.GetValueOrDefault())
            {
                return;
            }
            this.Workspace.AddDomain(new SharedDomainBuilder().WithName(domainEditorViewModel.DomainName)
                                     .Inside(Workspace.WorkspaceModel.Model)
                                     .WithDomain(domainEditorViewModel.DomainExpression)
                                     .Build());
        }
        public override void Edit()
        {
            var domainEditorViewModel = new SharedDomainEditorViewModel();

            domainEditorViewModel.DomainName       = Domain.Name;
            domainEditorViewModel.DomainExpression = Domain.Expression.Text;
            var result = _windowManager.ShowDialog(domainEditorViewModel);

            if (!result.GetValueOrDefault())
            {
                return;
            }
            DisplayName    = Domain.Name.Text = domainEditorViewModel.DomainName;
            ExpressionText = Domain.Expression.Text = domainEditorViewModel.DomainExpression;
        }