Beispiel #1
0
        public void Write2Rows()
        {
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                using (IWorksheetWriter writer = spreadsheet.WriteToWorksheet("UnitTests"))
                {
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("A1"));
                    writer.WriteRow(new List <string> {
                        "One", "Two", "Three"
                    });
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("A2"));
                    writer.WriteRow(new List <string> {
                        "Four", "Five", "Six"
                    });
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("A3"));
                }
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests");
                List <string>    list   = reader.ReadRow();
                Assert.That(list, Is.Not.Empty);
                Assert.That(list, Is.EquivalentTo(new List <string> {
                    "One", "Two", "Three"
                }));
                list = reader.ReadRow();
                Assert.That(list, Is.Not.Empty);
                Assert.That(list, Is.EquivalentTo(new List <string> {
                    "Four", "Five", "Six"
                }));
            }
        }
Beispiel #2
0
        public void ReadRowAfterMoveUsingAddress()
        {
            WriteTestValues();
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests");
                reader.MoveTo("B1");
                List <string> row1 = reader.ReadRow();
                List <string> row2 = reader.ReadRow();
                Assert.That(row1, Is.EquivalentTo(new List <string> {
                    "B-1", "C-1"
                }));
                Assert.That(row2, Is.EquivalentTo(new List <string> {
                    "B-2", "C-2"
                }));

                reader.MoveTo("A1");
                Assert.That(reader.ReadRow(), Is.EquivalentTo(new List <string> {
                    "A-1", "B-1", "C-1"
                }));
                Assert.That(reader.ReadRow(), Is.EquivalentTo(new List <string> {
                    "A-2", "B-2", "C-2"
                }));
            }
        }
        public void WriteEnterpriseSiteArea()
        {
            Hierarchy hierarchy = new Hierarchy();

            hierarchy.Enterprise = new Enterprise("My Company");
            hierarchy.Enterprise.Site.Add(new Site("My Site"));
            hierarchy.Enterprise.Site[0].Area.Add(new Area("My Area"));

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                HierarchyWriterCommand command = new HierarchyWriterCommand(hierarchy, spreadsheet);
                command.Execute();
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                using (IWorksheetReader reader = spreadsheet.ReadWorksheet("Hierarchy"))
                {
                    reader.MoveTo("A1");
                    Assert.That(reader.ReadRow(), Is.EquivalentTo(expectedHeader));
                    CheckRow(reader, "A2", 1, "Enterprise", string.Empty, "My Company");
                    CheckRow(reader, "A3", 2, "Site", string.Empty, "My Site");
                    CheckRow(reader, "A4", 3, "Area", string.Empty, "My Area");
                }
            }
        }
        public void ReadEnterpriseSiteArea()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(header);
                WriteRow(writer, "A2", 1, "Enterprise", "", "My Enterprise");
                WriteRow(writer, "A3", 2, "Site", "", "My Site");
                WriteRow(writer, "A4", 3, "Area", "", "My Area");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    command.Execute();
                }

                Assert.That(hierarchy, Is.Not.Null);
                Assert.That(hierarchy.GetCount(), Is.EqualTo(3));
                Assert.That(hierarchy.Enterprise, Is.Not.Null);
                Assert.That(hierarchy.Enterprise.Name, Is.EqualTo("My Enterprise"));
                Assert.That(hierarchy.Enterprise.Site, Is.Not.Empty);
                Assert.That(hierarchy.Enterprise.Site.Count, Is.EqualTo(1));
                Assert.That(hierarchy.Enterprise.Site[0].Name, Is.EqualTo("My Site"));
                Assert.That(hierarchy.Enterprise.Site[0].Area, Is.Not.Empty);
                Assert.That(hierarchy.Enterprise.Site[0].Area[0].Name, Is.EqualTo("My Area"));
                Assert.That(hierarchy.Enterprise.Site[0].Area[0].Area1, Is.Empty);
            }
        }
Beispiel #5
0
        public void Write()
        {
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                using (IWorksheetWriter writer = spreadsheet.WriteToWorksheet("UnitTests"))
                {
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("A1"));
                    writer.Write("One");
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("B1"));

                    writer.MoveTo("D3");
                    writer.Write("New value at D3");
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("E3"));
                }
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests");
                reader.MoveTo("A1");
                Assert.That(reader.Read(), Is.EqualTo("One"));
                Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("B1"));
                reader.MoveTo("D3");
                Assert.That(reader.Read(), Is.EqualTo("New value at D3"));
                Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("E3"));
            }
        }
Beispiel #6
0
        public void GetCurrentCellAfterMoveRowColumn()
        {
            WriteTestValues();
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests");
                Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("A1"));
                Assert.That(reader.GetCurrentCell().Row, Is.EqualTo(1));
                Assert.That(reader.GetCurrentCell().Column, Is.EqualTo(1));
                Assert.That(reader.GetCurrentCell().Value, Is.EqualTo("A-1"));

                reader.MoveTo(2, 1);

                Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("A2"));
                Assert.That(reader.GetCurrentCell().Row, Is.EqualTo(2));
                Assert.That(reader.GetCurrentCell().Column, Is.EqualTo(1));
                Assert.That(reader.GetCurrentCell().Value, Is.EqualTo("A-2"));

                reader.MoveTo(1, 3);

                Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("C1"));
                Assert.That(reader.GetCurrentCell().Row, Is.EqualTo(1));
                Assert.That(reader.GetCurrentCell().Column, Is.EqualTo(3));
                Assert.That(reader.GetCurrentCell().Value, Is.EqualTo("C-1"));
            }
        }
        public void Read2SitesWithAreas()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(header);
                WriteRow(writer, "A2", 1, "Enterprise", "", "My Enterprise");
                WriteRow(writer, "A3", 2, "Site", "", "Site 1");
                WriteRow(writer, "A4", 3, "Area", "", "Area A");
                WriteRow(writer, "A5", 2, "Site", "", "Site 2");
                WriteRow(writer, "A6", 3, "Area", "", "Area B");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    command.Execute();
                }

                Assert.That(hierarchy, Is.Not.Null);
                Assert.That(hierarchy.GetCount(), Is.EqualTo(5));
                Assert.That(hierarchy.Enterprise.FullName, Is.EqualTo("My Enterprise"));
                Assert.That(hierarchy.Enterprise.Site[0].FullName, Is.EqualTo("My Enterprise.Site 1"));
                Assert.That(hierarchy.Enterprise.Site[0].Area[0].FullName, Is.EqualTo("My Enterprise.Site 1.Area A"));
                Assert.That(hierarchy.Enterprise.Site[1].FullName, Is.EqualTo("My Enterprise.Site 2"));
                Assert.That(hierarchy.Enterprise.Site[1].Area[0].FullName, Is.EqualTo("My Enterprise.Site 2.Area B"));
            }
        }
Beispiel #8
0
        public void MoveToAddress()
        {
            WriteTestValues();
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests");
                reader.MoveTo("A1");
                Assert.That(reader.Read(), Is.EqualTo("A-1"));

                reader.MoveTo("B2");
                Assert.That(reader.Read(), Is.EqualTo("B-2"));
            }
        }
            public void Dispose()
            {
                if (writer != null)
                {
                    writer.Dispose();
                    writer = null;
                }

                if (spreadsheet != null)
                {
                    spreadsheet.Dispose();
                    spreadsheet = null;
                }
            }
            public void Dispose()
            {
                if (writer != null)
                {
                    writer.Dispose();
                    writer = null;
                }

                if (spreadsheet != null)
                {
                    spreadsheet.Dispose();
                    spreadsheet = null;
                }
            }
        public void ReadNoHeader()
        {
            using (SetupWorksheet("Hierarchy"))
            {
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    Assert.Throws <InvalidOperationException>(command.Execute);
                }
            }
        }
Beispiel #12
0
        public void GetCurrentCell()
        {
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                using (IWorksheetWriter writer = spreadsheet.WriteToWorksheet("UnitTests"))
                {
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("A1"));
                    writer.MoveTo("B2");
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("B2"));

                    writer.MoveTo(10, 20);
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("T10"));
                }
            }
        }
Beispiel #13
0
 private void WriteTestValues()
 {
     using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
     {
         IWorksheetWriter writer = spreadsheet.WriteToWorksheet("UnitTests");
         writer.WriteRow(new List <string> {
             "A-1", "B-1", "C-1"
         });
         writer.WriteRow(new List <string> {
             "A-2", "B-2", "C-2"
         });
         writer.WriteRow(new List <string> {
             "A-3", "B-3", "C-3"
         });
     }
 }
Beispiel #14
0
 public void IsEndOfDataEmpty()
 {
     using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
     {
         using (spreadsheet.WriteToWorksheet("UnitTests"))
         {
         }
     }
     using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
     {
         using (IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests"))
         {
             Assert.That(reader.IsEndOfData(), Is.True);
         }
     }
 }
        public void ReadNoHeader()
        {
            using (SetupWorksheet("Hierarchy"))
            {
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    Exception ex = Assert.Throws <InvalidOperationException>(command.Execute);
                    Assert.That(ex.Message, Is.StringContaining("spreadsheet is empty"));
                }
            }
        }
        public void ReadInvalidDepth()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(header);
                WriteRow(writer, "A2", 10, "Enterprise", "", "My Enterprise");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    Assert.Throws <InvalidOperationException>(command.Execute);
                }
            }
        }
Beispiel #17
0
        public void ReadOnlyWorksheet()
        {
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                Assert.That(spreadsheet.IsReadOnly, Is.False);
                IWorksheetWriter worksheet = spreadsheet.WriteToWorksheet("New sheet");
                worksheet.WriteRow(new List <string> {
                    "One", "Two", "Three"
                });
                Assert.That(worksheet, Is.Not.Null);
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Assert.That(spreadsheet.IsReadOnly, Is.True);
                Assert.Throws <InvalidOperationException>(() => spreadsheet.WriteToWorksheet("Should fail"));
            }
        }
        public void ReadInvalidDepth()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(header);
                WriteRow(writer, "A2", "", "", "", "My Enterprise");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    Exception ex = Assert.Throws <InvalidOperationException>(command.Execute);
                    Assert.That(ex.Message, Is.StringContaining("My Enterprise").And.StringContaining("Level 4"));
                }
            }
        }
        public void ReadEmpty()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(header);
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    command.Execute();
                }

                Assert.That(hierarchy, Is.Not.Null);
                Assert.That(hierarchy.Enterprise, Is.Null);
                Assert.That(hierarchy.GetCount(), Is.EqualTo(0));
            }
        }
        public void HeaderWithIncorrectNames()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(new List <string> {
                    "Column 1", "Column 2", "Column 3", "Column 4"
                });
                WriteRow(writer, "A2", "My Enterprise");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    Exception ex = Assert.Throws <InvalidOperationException>(command.Execute);
                    Assert.That(ex.Message, Is.StringContaining("Column 1").And.StringContaining("Level 1"));
                }
            }
        }
Beispiel #21
0
        public void ReadRow()
        {
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                IWorksheetWriter writer = spreadsheet.WriteToWorksheet("UnitTests");
                List <string>    list   = new List <string> {
                    "One", "Two", "Three"
                };
                writer.WriteRow(list);
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests");
                List <string>    list   = reader.ReadRow();
                Assert.That(list, Is.Not.Empty);
                Assert.That(list, Is.EquivalentTo(new List <string> {
                    "One", "Two", "Three"
                }));
            }
        }
        public void Level2HeaderWithGreaterDepth()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(new List <string> {
                    "Level 1", "Level 2"
                });
                WriteRow(writer, "A2", "My Enterprise");
                WriteRow(writer, "A3", "", "My Site");
                WriteRow(writer, "A4", "", "", "My Area");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    Exception ex = Assert.Throws <InvalidOperationException>(command.Execute);
                    Assert.That(ex.Message, Is.StringContaining("row 4"));
                }
            }
        }
Beispiel #23
0
        public void MoveToAndWrite()
        {
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                using (IWorksheetWriter writer = spreadsheet.WriteToWorksheet("UnitTests"))
                {
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("A1"));
                    writer.MoveTo("B2");
                    writer.WriteRow(new List <string> {
                        "One", "Two", "Three"
                    });
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("B3"));
                    writer.WriteRow(new List <string> {
                        "Four", "Five", "Six"
                    });
                    Assert.That(writer.GetCurrentCell().Address, Is.EqualTo("B4"));
                }
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                using (IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests"))
                {
                    Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("A1"));
                    Assert.That(reader.ReadRow(), Is.EquivalentTo(new List <string>()));

                    reader.MoveTo("B2");
                    Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("B2"));
                    Assert.That(reader.ReadRow(), Is.EquivalentTo(new List <string> {
                        "One", "Two", "Three"
                    }));
                    Assert.That(reader.GetCurrentCell().Address, Is.EqualTo("B3"));
                    Assert.That(reader.ReadRow(), Is.EquivalentTo(new List <string> {
                        "Four", "Five", "Six"
                    }));
                }
            }
        }
Beispiel #24
0
        public void IsEndOfData()
        {
            WriteTestValues();
            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                using (IWorksheetReader reader = spreadsheet.ReadWorksheet("UnitTests"))
                {
                    string[] falseAddresses = new[] { "A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3", "D1", "D2" };
                    string[] trueAddresses  = new [] { "A4", "A5", "B4", "B5", "C4", "C5", "D3", "D4", "D5" };
                    foreach (string address in falseAddresses)
                    {
                        reader.MoveTo(address);
                        Assert.That(reader.IsEndOfData(), Is.False, "EndOfData = false for {0}", address);
                    }

                    foreach (string address in trueAddresses)
                    {
                        reader.MoveTo(address);
                        Assert.That(reader.IsEndOfData(), Is.True, "EndOfData = true for {0}", address);
                    }
                }
            }
        }
        public void Level2HeaderEnterpriseOnly()
        {
            using (IWorksheetWriter writer = SetupWorksheet("Hierarchy"))
            {
                writer.WriteRow(new List <string> {
                    "Level 1", "Level 2"
                });
                WriteRow(writer, "A2", "My Enterprise");
            }

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                Hierarchy hierarchy = Hierarchy.Empty();
                using (ICommand command = CreateCommand(spreadsheet, hierarchy))
                {
                    command.Execute();
                }

                Assert.That(hierarchy, Is.Not.Null);
                Assert.That(hierarchy.Enterprise, Is.Not.Null);
                Assert.That(hierarchy.Enterprise.Name, Is.EqualTo("My Enterprise"));
                Assert.That(hierarchy.GetCount(), Is.EqualTo(1));
            }
        }
Beispiel #26
0
        public void ReadAndWrite()
        {
            List <string> list = new List <string> {
                "One", "Two", "Three"
            };

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.CreateNew(Filename))
            {
                IWorksheetWriter worksheet = spreadsheet.WriteToWorksheet("New sheet");
                Assert.That(worksheet, Is.Not.Null);
                worksheet.WriteRow(list);
            }

            List <string> result;

            using (IExcelSpreadsheet spreadsheet = ExcelSpreadsheet.OpenReadOnly(Filename))
            {
                IWorksheetReader worksheet = spreadsheet.ReadWorksheet("New sheet");
                Assert.That(worksheet, Is.Not.Null);
                result = worksheet.ReadRow();
            }

            Assert.That(result, Is.EquivalentTo(list));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExcelWriterCommand"/> class.
 /// </summary>
 /// <param name="spreadsheet">The spreadsheet.</param>
 /// <param name="name">The name.</param>
 protected ExcelWriterCommand(IExcelSpreadsheet spreadsheet, string name)
 {
     worksheetWriter = spreadsheet.WriteToWorksheet(name);
 }
 public Worksheet(string filename, string name)
 {
     spreadsheet = ExcelSpreadsheet.CreateNew(filename);
     writer      = spreadsheet.WriteToWorksheet(name);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExcelReaderCommand"/> class.
 /// </summary>
 /// <param name="spreadsheet">The spreadsheet.</param>
 /// <param name="name">The name.</param>
 protected ExcelReaderCommand(IExcelSpreadsheet spreadsheet, string name)
 {
     worksheetReader = spreadsheet.ReadWorksheet(name);
 }
 public Worksheet(string filename, string name)
 {
     spreadsheet = ExcelSpreadsheet.CreateNew(filename);
     writer = spreadsheet.WriteToWorksheet(name);
 }
 private ICommand CreateCommand(IExcelSpreadsheet spreadsheet, Hierarchy hierarchy)
 {
     return(new HierarchyReaderCommand(spreadsheet, hierarchy));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExcelReaderCommand"/> class.
 /// </summary>
 /// <param name="spreadsheet">The spreadsheet.</param>
 /// <param name="name">The name.</param>
 protected ExcelReaderCommand(IExcelSpreadsheet spreadsheet, string name)
 {
     worksheetReader = spreadsheet.ReadWorksheet(name);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HierarchyWriterCommand"/> class.
 /// </summary>
 /// <param name="hierarchy">The hierarchy.</param>
 /// <param name="spreadsheet">The spreadsheet.</param>
 public HierarchyWriterCommand(Hierarchy hierarchy, IExcelSpreadsheet spreadsheet)
     : base(spreadsheet, "Hierarchy")
 {
     this.hierarchy = hierarchy;
 }
 private ICommand CreateCommand(IExcelSpreadsheet spreadsheet, Hierarchy hierarchy)
 {
     return new SimpleHierarchyReaderCommand(spreadsheet, hierarchy);
 }
 public SimpleHierarchyReaderCommand(IExcelSpreadsheet spreadsheet, Hierarchy hierarchy) : base(spreadsheet, "Hierarchy")
 {
     this.hierarchy = hierarchy;
 }
 public SimpleHierarchyReaderCommand(IExcelSpreadsheet spreadsheet, Hierarchy hierarchy)
     : base(spreadsheet, "Hierarchy")
 {
     this.hierarchy = hierarchy;
 }
Beispiel #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExcelWriterCommand"/> class.
 /// </summary>
 /// <param name="spreadsheet">The spreadsheet.</param>
 /// <param name="name">The name.</param>
 protected ExcelWriterCommand(IExcelSpreadsheet spreadsheet, string name)
 {
     worksheetWriter = spreadsheet.WriteToWorksheet(name);
 }