Ejemplo n.º 1
0
        public void CopySheet(Sheet originalSheet)
        {
            Excel._Worksheet oSheet = sheetDict[originalSheet];
            Excel._Worksheet endSheet = getEndSheet();
            sheetCounter += 1;

            // Copy Sheet to the last position in the workbook
            oSheet.Copy(Type.Missing,endSheet);

            Excel._Worksheet copySheet = getEndSheet();
            initializeNewSheet(copySheet);
        }
Ejemplo n.º 2
0
 public Workbook( Excel._Workbook oWB)
 {
     this.oWB = oWB;
     this.workbookSheets = oWB.Sheets;
     foreach (Excel._Worksheet openedWorkSheet in workbookSheets)
     {
         sheetCounter += 1;
         Sheet openedSheet = new Sheet(openedWorkSheet);
         setIndex(openedSheet);
         Sheets.Add(openedSheet);
         sheetDict[openedSheet] = openedWorkSheet;
     }
     this.ActiveSheet = Sheets[0];
 }
Ejemplo n.º 3
0
 private void setIndex(Sheet addedSheet)
 {
     addedSheet.Index = sheetCounter;
 }
Ejemplo n.º 4
0
 private void initializeNewSheet(Excel._Worksheet ws)
 {
     Sheet addedSheet = new Sheet(ws);
     setIndex(addedSheet);
     sheets.Add(addedSheet);
     sheetDict[addedSheet] = ws;
     RecentlyAddedSheet = addedSheet;
 }
Ejemplo n.º 5
0
 private DirectoryLinkWriter SetupSolutionDirectoryWriter()
 {
     string relativeSolutionDirectory = "../../../.";
     testFactory = new LinkSheetFactory(testWorkbook, relativeSolutionDirectory);
     linkSheet = testFactory.ExecuteMake() as Sheet;
     return linkSheet.Writer as DirectoryLinkWriter;
 }
Ejemplo n.º 6
0
 private void SetupLinkSheet()
 {
     linkSheet = (Sheet)testFactory.ExecuteMake();
 }
 private static void WriterAssertions(Sheet testSheet, DateTime testDate, string pathToDirectory)
 {
     DirectoryLinkWriter sourceWriter = testSheet.Writer as DirectoryLinkWriter;
     Assert.That(testSheet.Writer, Is.InstanceOf<LinkWriter>());
     Assert.That(sourceWriter.LinkDate, Is.EqualTo(testDate));
     Assert.That(sourceWriter.DirectoryPath, Is.EqualTo(pathToDirectory));
 }
Ejemplo n.º 8
0
 private void SetSheetUtilities(Sheet newSheet)
 {
     newSheet.Writer = sheetWriter;
     newSheet.EmbedTool = sheetTools;
 }