public VAQUERY.QueryResultList <string> QueryFormulas(IList <IVisio.Shape> target_shapes, IList <ShapeSheet.SRC> srcs) { 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(); int ci = 0; foreach (var src in srcs) { string colname = $"Col{ci}"; query.AddCell(src, colname); ci++; } var formulas = query.GetFormulas(surface, shapeids); return(formulas); }
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); }
private static void check_query(VAQUERY.CellQuery query) { if (query.CellColumns.Count != 0) { throw new AutomationException("Query should not contain any Columns"); } if (query.SectionColumns.Count != 1) { throw new AutomationException("Query should not contain contain exaxtly 1 section"); } }
public static IList <T> _GetCells <T, RT>( IVisio.Shape shape, VAQUERY.CellQuery query, RowToObject <T, RT> row_to_object) { CellGroupMultiRow.check_query(query); var data_for_shape = query.GetCellData <RT>(shape); var sec = data_for_shape.Sections[0]; var sec_objects = CellGroupMultiRow.SectionToObjectList(sec, row_to_object); return(sec_objects); }
public static IList <T> _GetCells <T, RT>( IVisio.Shape shape, VA.ShapeSheet.Query.CellQuery query, RowToObject <T, RT> row_to_object) { check_query(query); var data_for_shape = query.GetFormulasAndResults <RT>(shape); var sec = data_for_shape.SectionCells[0]; var sec_objects = SectionToObjectList(sec, row_to_object); return(sec_objects); }
public static IList <List <T> > _GetCells <T, RT>( IVisio.Page page, IList <int> shapeids, VA.ShapeSheet.Query.CellQuery query, RowToObject <T, RT> row_to_object) { check_query(query); var list = new List <List <T> >(shapeids.Count); var data_for_shapes = query.GetFormulasAndResults <RT>(new VA.Drawing.DrawingSurface(page), shapeids); foreach (var data_for_shape in data_for_shapes) { var sec = data_for_shape.SectionCells[0]; var sec_objects = SectionToObjectList(sec, row_to_object); list.Add(sec_objects); } return(list); }
public static IList <List <T> > _GetCells <T, RT>( IVisio.Page page, IList <int> shapeids, VAQUERY.CellQuery query, RowToObject <T, RT> row_to_object) { CellGroupMultiRow.check_query(query); var list = new List <List <T> >(shapeids.Count); var surface = new ShapeSheetSurface(page); var data_for_shapes = query.GetCellData <RT>(surface, shapeids); foreach (var data_for_shape in data_for_shapes) { var sec = data_for_shape.Sections[0]; var sec_objects = CellGroupMultiRow.SectionToObjectList(sec, row_to_object); list.Add(sec_objects); } return(list); }
public VAQUERY.QueryResultList <T> QueryResults <T>(IList <IVisio.Shape> target_shapes, IList <ShapeSheet.SRC> srcs) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); var shapes = this.GetTargetShapes(target_shapes); var surface = this._client.ShapeSheet.GetShapeSheetSurface(); var shapeids = shapes.Select(s => s.ID).ToList(); var query = new VAQUERY.CellQuery(); int ci = 0; foreach (var src in srcs) { string colname = String.Format("Col{0}", ci); query.AddCell(src, colname); ci++; } var results = query.GetResults <T>(surface, shapeids); return(results); }