TryStartAutoFill ( Microsoft.Office.Interop.Excel.Workbook oWorkbook, Boolean bShowVertexLabels, String sVertexLabelColumnName, out ListObject oEdgeTable, out ListObject oVertexTable, out ExcelHiddenColumns oHiddenEdgeColumns, out ExcelHiddenColumns oHiddenVertexColumns ) { Debug.Assert(oWorkbook != null); SetScreenUpdating(oWorkbook, false); (new VertexWorksheetPopulator()).PopulateVertexWorksheet( oWorkbook, false); oEdgeTable = oVertexTable = null; oHiddenEdgeColumns = oHiddenVertexColumns = null; if ( !ExcelUtil.TryGetTable(oWorkbook, WorksheetNames.Edges, TableNames.Edges, out oEdgeTable) || !ExcelUtil.TryGetTable(oWorkbook, WorksheetNames.Vertices, TableNames.Vertices, out oVertexTable) ) { return(false); } // Only visible cells are read and written to. Temporarily show all // hidden columns in the tables. oHiddenEdgeColumns = ExcelColumnHider.ShowHiddenColumns(oEdgeTable); oHiddenVertexColumns = ExcelColumnHider.ShowHiddenColumns( oVertexTable); if (bShowVertexLabels) { TableColumnMapper.MapViaCopy(oVertexTable, sVertexLabelColumnName, VertexTableColumnNames.Label); } return(true); }
AutoFillColumnViaCopy ( ListObject oTable, String sSourceColumnName, String sDestinationColumnName ) { Debug.Assert(oTable != null); Debug.Assert(!String.IsNullOrEmpty(sDestinationColumnName)); if (String.IsNullOrEmpty(sSourceColumnName)) { return; } TableColumnMapper.MapViaCopy( oTable, sSourceColumnName, sDestinationColumnName ); }