Ejemplo n.º 1
0
        /// <summary>
        /// Selects the <see cref="DiagramView"/> specified by <paramref name="designer"/> for this <see cref="MultiDiagramDocView"/>.
        /// </summary>
        /// <param name="designer">The <see cref="DiagramView"/> to be selected.</param>
        /// <returns>
        /// <see langword="true"/> if the <see cref="DiagramView"/> is successfully selected; otherwise, <see langword="false"/>.
        /// </returns>
        public bool SelectDesigner(DiagramView designer)
        {
            if (designer == null)
            {
                throw new ArgumentNullException("designer");
            }
            MultiDiagramDocViewControl control = myDocViewControl;
            int index;

            if (control != null && (index = control.IndexOf(designer, 0)) >= 0)
            {
                // Although a single DiagramView could theoretically appear on multiple tabs,
                // we only need to activate one.
                control.SelectedIndex = index;
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes the <see cref="DiagramView"/> specified by <paramref name="designer"/> from this <see cref="MultiDiagramDocView"/>.
        /// </summary>
        /// <param name="designer">The <see cref="DiagramView"/> to be removed.</param>
        public void RemoveDesigner(DiagramView designer)
        {
            if (designer == null)
            {
                throw new ArgumentNullException("designer");
            }
            MultiDiagramDocViewControl control = myDocViewControl;

            if (control == null)
            {
                return;
            }
            int lastIndex = 0;

            while ((lastIndex = control.IndexOf(designer, lastIndex)) >= 0)
            {
                RemoveAt(lastIndex);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Removes the <see cref="Diagram"/> specified by <paramref name="diagram"/> from this <see cref="MultiDiagramDocView"/>.
        /// </summary>
        /// <param name="diagram">The <see cref="Diagram"/> to be removed.</param>
        public void RemoveDiagram(Diagram diagram)
        {
            if (diagram == null)
            {
                throw new ArgumentNullException("diagram");
            }
            MultiDiagramDocViewControl control = myDocViewControl;

            if (control == null)
            {
                return;
            }
            int lastIndex = 0;

            while ((lastIndex = control.IndexOf(diagram, lastIndex)) >= 0)
            {
                RemoveAt(lastIndex);
            }
        }