Example #1
0
        /// <summary>
        /// Finds out if a relationship can be assigned automatically between the given source
        /// and target element.
        /// </summary>
        /// <remarks>
        /// This method is required becase reference relationship do not need to be serialized
        /// with an id. But shapes still need to be created for them if a visual information
        /// is provided in the diagrams model.
        /// </remarks>
        protected override DslModeling::ModelElement CanAssignRelationship(DslModeling::ModelElement source, DslModeling::ModelElement target)
        {
            if (source == null || target == null)
            {
                return(null);
            }

            global::Tum.FamilyTreeDSL.ParentOf instanceToReturn = null;

            System.Collections.ObjectModel.ReadOnlyCollection <global::Tum.FamilyTreeDSL.ParentOf> allMParentOfInstances = DslModeling::DomainRoleInfo.GetElementLinks <global::Tum.FamilyTreeDSL.ParentOf>(source, global::Tum.FamilyTreeDSL.ParentOf.ParentDomainRoleId);
            foreach (global::Tum.FamilyTreeDSL.ParentOf instance in allMParentOfInstances)
            {
                if (instance.Child.Id == target.Id)
                {
                    if (instanceToReturn == null)
                    {
                        instanceToReturn = instance;
                    }
                    else
                    {
                        return(null);
                    }
                }
            }

            return(instanceToReturn);
        }
 public PropertyGridParentOfViewModel(DslEditorViewModelData::ViewModelStore viewModelStore, global::Tum.FamilyTreeDSL.ParentOf element) : base(viewModelStore, element)
 {
 }