Esempio n. 1
0
        internal override void Invoke(CommandProcessorContext cpc)
        {
            var viewModel = _property.GetRootViewModel();

            Debug.Assert(viewModel != null, "Unable to find root view model from navigation property:" + _property.Name);
            if (viewModel != null)
            {
                var property = viewModel.ModelXRef.GetExisting(_property) as Model.Entity.NavigationProperty;
                Debug.Assert(property != null);
                DeleteEFElementCommand.DeleteInTransaction(cpc, property);
                viewModel.ModelXRef.Remove(property, _property);
            }
        }
Esempio n. 2
0
        internal override void Invoke(CommandProcessorContext cpc)
        {
            var viewModel = _property.GetRootViewModel();

            Debug.Assert(viewModel != null, "Unable to find root view model from navigation property: " + _property.Name);

            if (viewModel != null)
            {
                var property = viewModel.ModelXRef.GetExisting(_property) as Model.Entity.NavigationProperty;
                Debug.Assert(property != null);

                Command c  = new EntityDesignRenameCommand(property, _property.Name, true);
                var     cp = new CommandProcessor(cpc, c);
                cp.Invoke();
            }
        }
Esempio n. 3
0
        internal override void Invoke(CommandProcessorContext cpc)
        {
            var viewModel = _property.GetRootViewModel();

            Debug.Assert(viewModel != null, "Unable to find root view model from property: " + _property.Name);

            if (viewModel != null)
            {
                var entityType = viewModel.ModelXRef.GetExisting(_property.EntityType) as Model.Entity.EntityType;
                var cet        = entityType as ConceptualEntityType;
                Debug.Assert(entityType != null ? cet != null : true, "EntityType is not ConceptualEntityType");
                Debug.Assert(entityType != null);

                if (cet != null)
                {
                    var property = CreateNavigationPropertyCommand.CreateDefaultProperty(cpc, _property.Name, cet);
                    viewModel.ModelXRef.Add(property, _property, viewModel.EditingContext);
                }
            }
        }