Beispiel #1
0
        private void deleteConnector(Visio.Shape shape, int start, int number)
        {
            int n = 0;

            while (n < number)
            {
                shape.DeleteRow((short)Visio.VisSectionIndices.visSectionConnectionPts, short.Parse(start.ToString()));
                n++;
            }
        }
        public static void Delete(IVisio.Shape shape, int index)
        {
            if (shape == null)
            {
                throw new ArgumentNullException(nameof(shape));
            }

            if (index < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            var row = (IVisio.VisRowIndices)index;
            shape.DeleteRow( (short) IVisio.VisSectionIndices.visSectionControls, (short)row);
        }
Beispiel #3
0
        public static void Delete(IVisio.Shape shape, int index)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException("shape");
            }

            if (index < 0)
            {
                throw new System.ArgumentOutOfRangeException("index");
            }

            var row = (IVisio.VisRowIndices)index;

            shape.DeleteRow((short)IVisio.VisSectionIndices.visSectionConnectionPts, (short)row);
        }
        public static void Delete(IVisio.Shape shape, string name)
        {
            if (shape == null)
            {
                throw new ArgumentNullException(nameof(shape));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            CustomPropertyHelper.CheckValidCustomPropertyName(name);

            string full_prop_name = CustomPropertyHelper.GetRowName(name);

            short row = shape.CellsU[full_prop_name].Row;
            shape.DeleteRow((short)IVisio.VisSectionIndices.visSectionProp, row);
        }
        public static void Delete(IVisio.Shape shape, string name)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException(nameof(shape));
            }

            if (name == null)
            {
                throw new System.ArgumentNullException(nameof(name));
            }

            UserDefinedCellHelper.CheckValidName(name);

            string full_udcell_name = UserDefinedCellHelper.__GetRowName(name);

            short row = shape.CellsU[full_udcell_name].Row;

            shape.DeleteRow(_udcell_section, row);
        }
Beispiel #6
0
        public static void Delete(IVisio.Shape shape, string name)
        {
            if (shape == null)
            {
                throw new System.ArgumentNullException("shape");
            }

            if (name == null)
            {
                throw new System.ArgumentNullException("name");
            }

            CheckValidName(name);

            string full_prop_name = GetRowName(name);

            short row = shape.CellsU[full_prop_name].Row;

            shape.DeleteRow(_userdefinedcell_section, row);
        }
Beispiel #7
0
        /// <summary>
        /// Delete all rows in the Data Section that starts with the given row name.
        /// </summary>
        /// <param name="Shape">
        /// The Shape to delete the row(s) from.
        /// </param>
        /// <param name="rowName">The name of the row to delete.</param>
        public static void deleteDataSectionRow(Visio.Shape Shape, string rowName)
        {
            short numRows = Shape.get_RowCount(CaseTypes.SHAPE_DATA_SECTION);

            rowName = Utilities.spaceToUnderscore(rowName);

            // Iterate through the list of Data Section rows in reverse (since upon
            // deletion of a row, all row indexes after the deleted row gets shifted
            // up by 1) to safely delete any row that starts with the given rowName.
            short startIndex = --numRows;

            for (short r = startIndex; r >= 0; --r)
            {
                Visio.Cell labelCell = Shape.get_CellsSRC(CaseTypes.SHAPE_DATA_SECTION, r, CaseTypes.DS_LABEL_CELL);

                string labelValue = labelCell.get_ResultStr(Visio.VisUnitCodes.visUnitsString);
                if (labelValue.StartsWith(rowName))
                {
                    Shape.DeleteRow(CaseTypes.SHAPE_DATA_SECTION, r);
                }
            }
        }