Пример #1
0
 internal ShapeCacheItem(short shapeid, IVisio.VisSectionIndices sec_index, SectionQueryColumns sec_cols, int numrows)
 {
     this.ShapeId             = shapeid;
     this.SectionIndex        = sec_index;
     this.SectionQueryColumns = sec_cols;
     this.RowCount            = numrows;
 }
Пример #2
0
        public static string GetSectionName(IVisio.VisSectionIndices value)
        {
            string    s           = value.ToString();
            const int start_index = 10;       // Length of string "visSection"

            return(s.Substring(start_index)); // Get Rid of the visSection prefix
        }
Пример #3
0
 internal SectionQuery(CellQuery parent, int ordinal, IVisio.VisSectionIndices section)
 {
     this.Parent       = parent;
     this.Ordinal      = ordinal;
     this.SectionIndex = section;
     this.Columns      = new ColumnList();
 }
Пример #4
0
 public SIDSRC(
     short id,
     IVisio.VisSectionIndices section,
     IVisio.VisRowIndices row,
     IVisio.VisCellIndices cell) : this(id, (short)section, (short)row, (short)cell)
 {
 }
Пример #5
0
 internal SubQuery(int ordinal, IVisio.VisSectionIndices section)
 {
     this.Name         = VisioAutomation.ShapeSheet.ShapeSheetHelper.GetSectionName(section);
     this.Ordinal      = ordinal;
     this.SectionIndex = section;
     this.Columns      = new ListColumnSubQuery();
 }
Пример #6
0
 public Src(
     IVisio.VisSectionIndices section,
     IVisio.VisRowIndices row,
     IVisio.VisCellIndices cell)
     : this((short)section, (short)row, (short)cell)
 {
 }
Пример #7
0
 internal SectionColumn(int ordinal, IVisio.VisSectionIndices section)
 {
     this.Name         = ShapeSheetHelper.GetSectionName(section);
     this.Ordinal      = ordinal;
     this.SectionIndex = section;
     this.CellColumns  = new CellColumnList();
 }
Пример #8
0
        public SectionQueryColumns Add(IVisio.VisSectionIndices sec_index)
        {
            if (this._map_secindex_to_sec_cols.ContainsKey(sec_index))
            {
                string msg = string.Format("Already contains section index {0} (value={1})", sec_index, (int)sec_index);
                throw new System.ArgumentException(msg);
            }

            var sec_cols = new SectionQueryColumns(sec_index);

            this._list_section_query_columns.Add(sec_cols);
            this._map_secindex_to_sec_cols[sec_index] = sec_cols;
            return(sec_cols);
        }
Пример #9
0
        internal SubQuery Add(IVisio.VisSectionIndices section)
        {
            if (this._section_set.ContainsKey(section))
            {
                string msg = "Duplicate Section";
                throw new System.ArgumentException(msg);
            }

            int ordinal       = this.Items.Count;
            var section_query = new SubQuery(ordinal, section);

            this.Items.Add(section_query);
            this._section_set[section] = section_query;
            return(section_query);
        }
Пример #10
0
            public SectionQuery Add(IVisio.VisSectionIndices section)
            {
                if (this.hs_section.ContainsKey(section))
                {
                    string msg = string.Format("Duplicate Section");
                    throw new AutomationException(msg);
                }

                int ordinal       = items.Count;
                var section_query = new SectionQuery(this.parent, ordinal, section);

                this.items.Add(section_query);
                this.hs_section[section] = section_query;
                return(section_query);
            }
Пример #11
0
 internal Row(int shapeid, IVisio.VisSectionIndices secindex, VisioAutomation.Collections.ArraySegment <T> cells)
 {
     this.ShapeID      = shapeid;
     this.Cells        = cells;
     this.SectionIndex = secindex;
 }
Пример #12
0
 internal SubQueryOutputRow(VisioAutomation.Utilities.ArraySegment <T> cells, IVisio.VisSectionIndices sectionindex, int rowindex)
 {
     this.Cells        = cells;
     this.SectionIndex = sectionindex;
     this.RowIndex     = rowindex;
 }
Пример #13
0
        public VAQUERY.QueryResultList <string> QueryFormulas(IList <IVisio.Shape> target_shapes, IVisio.VisSectionIndices section, IList <IVisio.VisCellIndices> cells)
        {
            this.Client.Application.AssertApplicationAvailable();
            this.Client.Document.AssertDocumentAvailable();

            var shapes   = this.GetTargetShapes(target_shapes);
            var shapeids = shapes.Select(s => s.ID).ToList();

            var surface = this.Client.ShapeSheet.GetShapeSheetSurface();

            var query = new VAQUERY.CellQuery();
            var sec   = query.AddSection(section);

            int ci = 0;

            foreach (var cell in cells)
            {
                string name = $"Cell{ci}";
                sec.AddCell((short)cell, name);
                ci++;
            }

            var formulas = query.GetFormulas(surface, shapeids);

            return(formulas);
        }
Пример #14
0
 internal SectionQueryOutput(int capacity, IVisio.VisSectionIndices section_index)
 {
     this.Rows = new SectionQueryOutputRowList<T>(capacity);
     this.SectionIndex = section_index;
 }
Пример #15
0
        public SectionColumn AddSection(IVisio.VisSectionIndices section)
        {
            var col = this.SectionColumns.Add(section);

            return(col);
        }
Пример #16
0
 internal SectionQueryColumns(IVisio.VisSectionIndices section)
 {
     this.SectionIndex = section;
 }
Пример #17
0
        internal static SRCFromCellIndex GetSRCFactory(IVisio.VisSectionIndices sec, IVisio.VisRowIndices row)
        {
            SRCFromCellIndex new_func = (IVisio.VisCellIndices cell) => new VA.ShapeSheet.SRC(sec, row, cell);

            return(new_func);
        }
Пример #18
0
        public VA.ShapeSheet.Query.CellQuery.QueryResultList <string> QueryFormulas(IList <IVisio.Shape> target_shapes, IVisio.VisSectionIndices section, IList <IVisio.VisCellIndices> cells)
        {
            this.AssertApplicationAvailable();
            this.AssertDocumentAvailable();

            var shapes   = this.GetTargetShapes(target_shapes);
            var shapeids = shapes.Select(s => s.ID).ToList();

            var surface = this.Client.Draw.GetDrawingSurfaceSafe();

            var query = new VA.ShapeSheet.Query.CellQuery();
            var sec   = query.Sections.Add(section);

            int ci = 0;

            foreach (var cell in cells)
            {
                string name = string.Format("Cell{0}", ci);
                sec.Columns.Add((short)cell, name);
                ci++;
            }

            var formulas = query.GetFormulas(surface, shapeids);

            return(formulas);
        }
Пример #19
0
        private static ShapeCacheItem _create_shapesectioncacheitem(ShapeIDPair shapeidpair, IVisio.VisSectionIndices sec_index, SectionQueryColumns sec_cols)
        {
            // first count the rows in the section

            int row_count = 0;

            // For visSectionObject we know the result is always going to be 1
            // so avoid making the call to RowCount[]
            if (sec_index == IVisio.VisSectionIndices.visSectionObject)
            {
                row_count = 1;
            }
            else
            {
                // For all other cases use RowCount[]
                row_count = shapeidpair.Shape.RowCount[(short)sec_index];
            }

            var shapecacheitem = new ShapeCacheItem((short)shapeidpair.ShapeID, sec_index, sec_cols, row_count);

            return(shapecacheitem);
        }
 internal SectionShapeRows(int capacity, int shapeid, IVisio.VisSectionIndices section_index) : base(capacity)
 {
     this.ShapeID      = shapeid;
     this.SectionIndex = section_index;
 }
Пример #21
0
        public SubQuery AddSubQuery(IVisio.VisSectionIndices section)
        {
            var col = this.SubQueries.Add(section);

            return(col);
        }
Пример #22
0
        internal static SRCFromCellIndex GetSRCFactory(IVisio.VisSectionIndices sec, IVisio.VisRowIndices row)
        {
            SRCFromCellIndex new_func = cell => new SRC(sec, row, cell);

            return(new_func);
        }