Skip to content

Commit 5c0e414

Browse files
Cleanup
1 parent e280ef4 commit 5c0e414

7 files changed

Lines changed: 8 additions & 168 deletions

File tree

NanoXLSX.Core/Interfaces/IPlugin.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
* This library is licensed under the MIT License.
55
* You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
66
*/
7-
using System;
8-
using System.IO;
9-
107
namespace NanoXLSX.Interfaces
118
{
129
/// <summary>

NanoXLSX.Core/Interfaces/Reader/IPluginBaseReader.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
using System;
9+
using System.CodeDom.Compiler;
910
using System.IO;
1011

1112
namespace NanoXLSX.Interfaces.Reader
@@ -30,5 +31,10 @@ internal interface IPluginBaseReader : IPluginReader
3031
/// <param name="inlinePluginHandler">Reference to the a handler action, to be used for post operations in reader methods</param>
3132
void Init(MemoryStream stream, Workbook workbook, IOptions readerOptions, Action<MemoryStream, Workbook, string, IOptions, int?> inlinePluginHandler);
3233

34+
/// <summary>
35+
/// Reference to a handler of in-line plugins, to be used for post operations in the <see cref="IPlugin.Execute"/> method
36+
/// </summary>
37+
Action<MemoryStream, Workbook, string, IOptions, int?> InlinePluginHandler { get; set; }
38+
3339
}
3440
}

NanoXLSX.Core/Interfaces/Reader/IPluginQueueReader.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
66
*/
77

8-
using System;
9-
using System.IO;
10-
118
namespace NanoXLSX.Interfaces.Reader
129
{
1310
/// <summary>

NanoXLSX.Core/Interfaces/Reader/IWorksheetReader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
66
*/
77

8-
using System;
98
using System.Collections.Generic;
109

1110
namespace NanoXLSX.Interfaces.Reader

NanoXLSX.Core/Interfaces/Writer/IColorWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
66
*/
77

8+
using System.Collections.Generic;
89
using NanoXLSX.Colors;
910
using NanoXLSX.Utils.Xml;
10-
using System.Collections.Generic;
1111

1212
namespace NanoXLSX.Interfaces.Writer
1313
{

NanoXLSX.Core/Interfaces/Writer/IPasswordWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
66
*/
77

8-
using NanoXLSX.Utils.Xml;
98
using System.Collections.Generic;
9+
using NanoXLSX.Utils.Xml;
1010
using static NanoXLSX.Enums.Password;
1111

1212

NanoXLSX.Writer-Reader.Test/Misc/XlsxWriterTest.cs

Lines changed: 0 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -88,164 +88,5 @@ public void SanitizeXmlValueAttributeTest(string givenPrePostFix, int charToEsca
8888
Workbook givenWorkbook = TestUtils.WriteAndReadWorkbook(workbook);
8989
Assert.Equal(expectedText, givenWorkbook.CurrentWorksheet.SheetName);
9090
}
91-
92-
[Fact]
93-
public void styleTest()
94-
{
95-
Workbook wb = new Workbook(@"C:\purge-temp\test1\files\styleTest1.xlsx", "worksheet1");
96-
Style s1 = new Style();
97-
SrgbColor c1 = new SrgbColor("FFCC34AF");
98-
s1.CurrentFill.SetColor(c1, Fill.FillType.FillColor);
99-
wb.CurrentWorksheet.AddCell("SRGB(FFCC34AF) - Fill", "A1", s1);
100-
101-
Style s2 = new Style();
102-
SrgbColor c2 = new SrgbColor("FFAADD00");
103-
s2.CurrentFill.SetColor(c2, Fill.FillType.PatternColor);
104-
s2.CurrentFill.PatternFill = Fill.PatternValue.MediumGray;
105-
wb.CurrentWorksheet.AddCell("SRGB(FFAADD00) - Pattern", "A2", s2);
106-
107-
Style s3 = new Style();
108-
IndexedColor c3 = new IndexedColor(IndexedColor.Value.DarkTeal);
109-
s3.CurrentFill.SetColor(c3, Fill.FillType.FillColor);
110-
wb.CurrentWorksheet.AddCell("Indexed(DarkTeal) - Fill", "A3", s3);
111-
112-
Style s4 = new Style();
113-
IndexedColor c4 = new IndexedColor(IndexedColor.Value.Rose);
114-
s4.CurrentFill.SetColor(c4, Fill.FillType.PatternColor);
115-
s4.CurrentFill.PatternFill = Fill.PatternValue.LightGray;
116-
wb.CurrentWorksheet.AddCell("Indexed(Rose) - Pattern", "A4", s4);
117-
118-
Style s5 = new Style();
119-
ThemeColor c5 = new ThemeColor(Theme.ColorSchemeElement.Accent1);
120-
s5.CurrentFill.SetColor(c5, Fill.FillType.FillColor);
121-
wb.CurrentWorksheet.AddCell("Theme(Accent1) - Fill", "A5", s5);
122-
123-
Style s6 = new Style();
124-
ThemeColor c6 = new ThemeColor(Theme.ColorSchemeElement.Light1);
125-
s6.CurrentFill.SetColor(c6, Fill.FillType.PatternColor);
126-
s6.CurrentFill.PatternFill = Fill.PatternValue.LightGray;
127-
wb.CurrentWorksheet.AddCell("Theme(Light1) - Pattern", "A6", s6);
128-
129-
Style s7 = new Style();
130-
AutoColor c7 = new AutoColor();
131-
s7.CurrentFill.SetColor(c7, Fill.FillType.FillColor);
132-
wb.CurrentWorksheet.AddCell("Auto - Fill", "A7", s7);
133-
134-
Style s8 = new Style();
135-
AutoColor c8 = new AutoColor();
136-
s8.CurrentFill.SetColor(c8, Fill.FillType.PatternColor);
137-
s8.CurrentFill.PatternFill = Fill.PatternValue.LightGray;
138-
wb.CurrentWorksheet.AddCell("Auto(LightGray Pattern) - Pattern", "A8", s8);
139-
140-
Style s9 = new Style();
141-
SrgbColor c9 = new SrgbColor("FFCC34AF");
142-
s9.CurrentFont.ColorValue = Color.CreateRgb(c9);
143-
wb.CurrentWorksheet.AddCell("SRGB(FFCC34AF) - Font", "B1", s9);
144-
145-
Style s10 = new Style();
146-
IndexedColor c10 = new IndexedColor(IndexedColor.Value.Salmon);
147-
s10.CurrentFont.ColorValue = Color.CreateIndexed(c10);
148-
wb.CurrentWorksheet.AddCell("Indexed(Salmon) - Font", "B2", s10);
149-
150-
Style s11 = new Style();
151-
ThemeColor c11 = new ThemeColor(Theme.ColorSchemeElement.Hyperlink);
152-
s11.CurrentFont.ColorValue = Color.CreateTheme(c11);
153-
wb.CurrentWorksheet.AddCell("Theme(Hyperlink) - Font", "B3", s11);
154-
155-
Style s12 = new Style();
156-
SystemColor c12 = new SystemColor(SystemColor.Value.ScrollBar);
157-
s12.CurrentFont.ColorValue = Color.CreateSystem(c12);
158-
wb.CurrentWorksheet.AddCell("System(ScrollBar) - Font", "B4", s12);
159-
160-
Style s13 = new Style();
161-
s13.CurrentFont.ColorValue = 63;// Color.CreateAuto();
162-
wb.CurrentWorksheet.AddCell("Auto - Font", "B5", s13);
163-
164-
// ---
165-
166-
Style s100 = new Style();
167-
SrgbColor c100 = new SrgbColor("FFCC34AF");
168-
s100.CurrentFill.SetColor(c100, Fill.FillType.FillColor);
169-
s100.CurrentFill.ForegroundColor.Tint = 0.75;
170-
wb.CurrentWorksheet.AddCell("SRGB(FFCC34AF) - Fill", "C1", s100);
171-
172-
Style s200 = new Style();
173-
SrgbColor c200 = new SrgbColor("FFAADD00");
174-
s200.CurrentFill.SetColor(c200, Fill.FillType.PatternColor);
175-
s200.CurrentFill.PatternFill = Fill.PatternValue.MediumGray;
176-
s200.CurrentFill.BackgroundColor.Tint = 0.75;
177-
wb.CurrentWorksheet.AddCell("SRGB(FFAADD00) - Pattern", "C2", s200);
178-
179-
Style s300 = new Style();
180-
IndexedColor c300 = new IndexedColor(IndexedColor.Value.DarkTeal);
181-
s300.CurrentFill.SetColor(c300, Fill.FillType.FillColor);
182-
s300.CurrentFill.ForegroundColor.Tint = -0.75;
183-
wb.CurrentWorksheet.AddCell("Indexed(DarkTeal) - Fill", "C3", s300);
184-
185-
Style s400 = new Style();
186-
IndexedColor c400 = new IndexedColor(IndexedColor.Value.Rose);
187-
s400.CurrentFill.SetColor(c400, Fill.FillType.PatternColor);
188-
s400.CurrentFill.PatternFill = Fill.PatternValue.LightGray;
189-
s400.CurrentFill.BackgroundColor.Tint = -0.75;
190-
wb.CurrentWorksheet.AddCell("Indexed(Rose) - Pattern", "C4", s400);
191-
192-
Style s500 = new Style();
193-
ThemeColor c500 = new ThemeColor(Theme.ColorSchemeElement.Accent1);
194-
s500.CurrentFill.SetColor(c5, Fill.FillType.FillColor);
195-
s500.CurrentFill.ForegroundColor.Tint = 0.333;
196-
wb.CurrentWorksheet.AddCell("Theme(Accent1) - Fill", "C5", s500);
197-
198-
Style s600 = new Style();
199-
ThemeColor c600 = new ThemeColor(Theme.ColorSchemeElement.Light1);
200-
s600.CurrentFill.SetColor(c600, Fill.FillType.PatternColor);
201-
s600.CurrentFill.PatternFill = Fill.PatternValue.LightGray;
202-
s600.CurrentFill.BackgroundColor.Tint = -0.333;
203-
wb.CurrentWorksheet.AddCell("Theme(Light1) - Pattern", "C6", s600);
204-
205-
Style s700 = new Style();
206-
AutoColor c700 = new AutoColor();
207-
s700.CurrentFill.SetColor(c700, Fill.FillType.FillColor);
208-
s700.CurrentFill.ForegroundColor.Tint = 0.5;
209-
wb.CurrentWorksheet.AddCell("Auto - Fill", "C7", s700);
210-
211-
Style s800 = new Style();
212-
AutoColor c800 = new AutoColor();
213-
s800.CurrentFill.SetColor(c800, Fill.FillType.PatternColor);
214-
s800.CurrentFill.PatternFill = Fill.PatternValue.LightGray;
215-
s800.CurrentFill.BackgroundColor.Tint = -0.5;
216-
wb.CurrentWorksheet.AddCell("Auto(LightGray Pattern) - Pattern", "C8", s800);
217-
218-
Style s900 = new Style();
219-
SrgbColor c900 = new SrgbColor("FFCC34AF");
220-
s900.CurrentFont.ColorValue = Color.CreateRgb(c900);
221-
s900.CurrentFont.ColorValue.Tint = 0.25;
222-
wb.CurrentWorksheet.AddCell("SRGB(FFCC34AF) - Font", "D1", s900);
223-
224-
Style s1000 = new Style();
225-
IndexedColor c1000 = new IndexedColor(IndexedColor.Value.Salmon);
226-
s1000.CurrentFont.ColorValue = Color.CreateIndexed(c1000);
227-
s1000.CurrentFont.ColorValue.Tint = -0.25;
228-
wb.CurrentWorksheet.AddCell("Indexed(Salmon) - Font", "D2", s1000);
229-
230-
Style s1100 = new Style();
231-
ThemeColor c1100 = new ThemeColor(Theme.ColorSchemeElement.Hyperlink);
232-
s1100.CurrentFont.ColorValue = Color.CreateTheme(c1100);
233-
s1100.CurrentFont.ColorValue.Tint = 0.95;
234-
wb.CurrentWorksheet.AddCell("Theme(Hyperlink) - Font", "D3", s1100);
235-
236-
Style s1200 = new Style();
237-
SystemColor c1200 = new SystemColor(SystemColor.Value.ScrollBar);
238-
s1200.CurrentFont.ColorValue = Color.CreateSystem(c1200);
239-
s1200.CurrentFont.ColorValue.Tint = -0.95;
240-
wb.CurrentWorksheet.AddCell("System(ScrollBar) - Font", "D4", s1200);
241-
242-
Style s1300 = new Style();
243-
s1300.CurrentFont.ColorValue = 63;// Color.CreateAuto();
244-
s1300.CurrentFont.ColorValue.Tint = 0.86;
245-
wb.CurrentWorksheet.AddCell("Auto - Font", "D5", s1300);
246-
247-
wb.Save();
248-
}
249-
25091
}
25192
}

0 commit comments

Comments
 (0)