예제 #1
0
        /// <summary>
        /// Verifies if the current shape can host a shape of a specific type.
        /// </summary>
        /// <param name="nodeShapeDomainClassId">Type of the shape specified by the domain class ID.</param>
        /// <returns>True if that specific type of shapes can be hosted by this shape. False otherwise.</returns>
        public virtual bool CanHostShape(Guid nodeShapeDomainClassId)
        {
            DiagramDomainDataDirectory data = this.Store.DomainDataAdvDirectory.ResolveExtensionDirectory <DiagramDomainDataDirectory>();

            if (data == null)
            {
                throw new ArgumentNullException("DiagramDomainDataDirectory can not be null");
            }

            List <Guid> vals = data.GetChildrenShapeTypes(this.GetDomainClass().Id);

            if (vals.Contains(nodeShapeDomainClassId))
            {
                return(true);
            }

            return(false);
        }