public ActivityDiagramElements GetDiagramElement(string name, ActivityDiagramElements.ElementTypes type = ActivityDiagramElements.ElementTypes.None)
        {
            if (DiagramElements == null)
            {
                return(null);
            }

            foreach (var element in DiagramElements)
            {
                if (element.Key == name)
                {
                    if (type == ActivityDiagramElements.ElementTypes.None)
                    {
                        return(element.Value);
                    }
                    else
                    {
                        if (type == element.Value.ElementType)
                        {
                            return(element.Value);
                        }
                    }
                }
            }

            return(null);
        }
        public ActivityDiagramElements GetDiagramElement(ActivityDiagramElements.ElementTypes type)
        {
            if (DiagramElements == null)
            {
                return(null);
            }

            foreach (var element in DiagramElements)
            {
                if (type == element.Value.ElementType)
                {
                    return(element.Value);
                }
            }

            return(null);
        }