Skip to content

Commit dd0436d

Browse files
committed
Rebrand Openize.Words to FileFormat.Words
- #21 - #22 - #23 -#24 - #25 - #26 - #27
1 parent 32b8d2a commit dd0436d

File tree

7 files changed

+115
-115
lines changed

7 files changed

+115
-115
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
namespace Openize.Words.IElements
3+
namespace FileFormat.Words.IElements
44
{
55
/// <summary>
66
/// Represents an element in a Word document.

Openize.Words.cs renamed to FileFormat.Words.cs

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

OpenXML.Templates.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12816,7 +12816,7 @@ private void GeneratePartContent(CoreFilePropertiesPart part,
1281612816
var subject = dict["Subject"];// "My Subject";//dict["Subject"];
1281712817
var keywords = dict["Keywords"];//"My Keyword";//dict["Keywords"];
1281812818
var description = dict["Description"];// "My Description";//dict["Description"];
12819-
var creator = dict["Creator"];// "Openize.Words"; //dict["Creator"];
12819+
var creator = dict["Creator"];// "FileFormat.Words"; //dict["Creator"];
1282012820
var created = dict["Created"];
1282112821
var modified = dict["Modified"];
1282212822
var writer = new System.Xml.XmlTextWriter(part.GetStream(
@@ -12850,7 +12850,7 @@ private void GeneratePartContent(ExtendedFilePropertiesPart part)
1285012850
var characters1 = new Ap.Characters();
1285112851
characters1.Text = "0";
1285212852
var application1 = new Ap.Application();
12853-
application1.Text = "Openize.Words";
12853+
application1.Text = "FileFormat.Words";
1285412854
var documentSecurity1 = new Ap.DocumentSecurity();
1285512855
documentSecurity1.Text = "0";
1285612856
var lines1 = new Ap.Lines();
@@ -12860,7 +12860,7 @@ private void GeneratePartContent(ExtendedFilePropertiesPart part)
1286012860
var scaleCrop1 = new Ap.ScaleCrop();
1286112861
scaleCrop1.Text = "false";
1286212862
var company1 = new Ap.Company();
12863-
company1.Text = "Openize.Words";
12863+
company1.Text = "FileFormat.Words";
1286412864
var linksUpToDate1 = new Ap.LinksUpToDate();
1286512865
linksUpToDate1.Text = "false";
1286612866
var charactersWithSpaces1 = new Ap.CharactersWithSpaces();

OpenXML.Words.Data.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
using DF = DocumentFormat.OpenXml;
55
using DocumentFormat.OpenXml.Packaging;
66
using WP = DocumentFormat.OpenXml.Wordprocessing;
7-
using FF = Openize.Words.IElements;
8-
using Openize.Words;
7+
using FF = FileFormat.Words.IElements;
8+
using FileFormat.Words;
99
using System.Linq;
1010

1111
namespace OpenXML.Words.Data
@@ -57,7 +57,7 @@ internal void Insert(FF.IElement newElement, int position, Document doc)
5757
{
5858
_staticDocDict.TryGetValue(doc.GetInstanceInfo(), out WordprocessingDocument staticDoc);
5959

60-
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new OpenizeException("Package or Document or Body is null", new NullReferenceException());
60+
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new FileFormatException("Package or Document or Body is null", new NullReferenceException());
6161

6262
_ooxmlDoc = OwDocument.CreateInstance(staticDoc);
6363

@@ -95,7 +95,7 @@ internal void Insert(FF.IElement newElement, int position, Document doc)
9595
staticDoc.MainDocumentPart.Document.Body.RemoveAllChildren();
9696
staticDoc.MainDocumentPart.Document.Body.Append(originalElements);
9797
var errorMessage = ConstructMessage(ex, "Remove OOXML Element(s)");
98-
throw new OpenizeException(errorMessage, ex);
98+
throw new FileFormatException(errorMessage, ex);
9999
}
100100
}
101101
}
@@ -106,7 +106,7 @@ internal void Update(FF.IElement newElement, int position, Document doc)
106106
{
107107
_staticDocDict.TryGetValue(doc.GetInstanceInfo(), out WordprocessingDocument staticDoc);
108108

109-
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new OpenizeException("Package or Document or Body is null", new NullReferenceException());
109+
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new FileFormatException("Package or Document or Body is null", new NullReferenceException());
110110

111111
_ooxmlDoc = OwDocument.CreateInstance(staticDoc);
112112

@@ -147,7 +147,7 @@ internal void Update(FF.IElement newElement, int position, Document doc)
147147
staticDoc.MainDocumentPart.Document.Body.RemoveAllChildren();
148148
staticDoc.MainDocumentPart.Document.Body.Append(originalElements);
149149
var errorMessage = ConstructMessage(ex, "Update OOXML Element(s)");
150-
throw new OpenizeException(errorMessage, ex);
150+
throw new FileFormatException(errorMessage, ex);
151151
}
152152
}
153153
}
@@ -158,7 +158,7 @@ internal void Remove(int position, Document doc)
158158
{
159159
_staticDocDict.TryGetValue(doc.GetInstanceInfo(), out WordprocessingDocument staticDoc);
160160

161-
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new OpenizeException("Package or Document or Body is null", new NullReferenceException());
161+
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new FileFormatException("Package or Document or Body is null", new NullReferenceException());
162162

163163
var enumerable = staticDoc.MainDocumentPart.Document.Body.Elements().ToList();
164164
var originalElements = new List<DF.OpenXmlElement>(enumerable);
@@ -174,7 +174,7 @@ internal void Remove(int position, Document doc)
174174
staticDoc.MainDocumentPart.Document.Body.RemoveAllChildren();
175175
staticDoc.MainDocumentPart.Document.Body.Append(originalElements);
176176
var errorMessage = ConstructMessage(ex, "Remove OOXML Element(s)");
177-
throw new OpenizeException(errorMessage, ex);
177+
throw new FileFormatException(errorMessage, ex);
178178
}
179179
}
180180
}
@@ -185,7 +185,7 @@ internal void Append(FF.IElement newElement, Document doc)
185185
{
186186
_staticDocDict.TryGetValue(doc.GetInstanceInfo(), out WordprocessingDocument staticDoc);
187187

188-
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new OpenizeException("Package or Document or Body is null", new NullReferenceException());
188+
if (staticDoc?.MainDocumentPart?.Document?.Body == null) throw new FileFormatException("Package or Document or Body is null", new NullReferenceException());
189189

190190
_ooxmlDoc = OwDocument.CreateInstance(staticDoc);
191191

@@ -225,7 +225,7 @@ internal void Append(FF.IElement newElement, Document doc)
225225
staticDoc.MainDocumentPart.Document.Body.RemoveAllChildren();
226226
staticDoc.MainDocumentPart.Document.Body.Append(originalElements);
227227
var errorMessage = ConstructMessage(ex, "Append OOXML Element(s)");
228-
throw new OpenizeException(errorMessage, ex);
228+
throw new FileFormatException(errorMessage, ex);
229229
}
230230
}
231231
}
@@ -245,7 +245,7 @@ internal void Save(System.IO.Stream stream, Document doc)
245245
catch (Exception ex)
246246
{
247247
var errorMessage = ConstructMessage(ex, "Save OOXML OWDocument");
248-
throw new OpenizeException(errorMessage, ex);
248+
throw new FileFormatException(errorMessage, ex);
249249
}
250250
}
251251
}

OpenXML.Words.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
using A = DocumentFormat.OpenXml.Drawing;
99
using DW = DocumentFormat.OpenXml.Drawing.Wordprocessing;
1010
using PIC = DocumentFormat.OpenXml.Drawing.Pictures;
11-
using FF = Openize.Words.IElements;
11+
using FF = FileFormat.Words.IElements;
1212
using OWD = OpenXML.Words.Data;
1313
using OT = OpenXML.Templates;
14-
using Openize.Words;
14+
using FileFormat.Words;
1515

1616
namespace OpenXML.Words
1717
{
@@ -52,7 +52,7 @@ private OwDocument()
5252
catch (Exception ex)
5353
{
5454
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Initialize OOXML Element(s)");
55-
throw new OpenizeException(errorMessage, ex);
55+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
5656
}
5757
}
5858
}
@@ -84,7 +84,7 @@ private OwDocument(WordprocessingDocument pkg)
8484
catch (Exception ex)
8585
{
8686
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Initialize OOXML Element(s)");
87-
throw new OpenizeException(errorMessage, ex);
87+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
8888
}
8989
}
9090
}
@@ -109,7 +109,7 @@ internal void CreateProperties(WordprocessingDocument pkgDocument)
109109
["Subject"] = "WordProcessing OWDocument Generation",
110110
["Keywords"] = "DOCX",
111111
["Description"] = "A WordProcessing OWDocument Created from Scratch.",
112-
["Creator"] = "Openize.Words"
112+
["Creator"] = "FileFormat.Words"
113113
};
114114
var currentTime = System.DateTime.UtcNow;
115115
dictCoreProp["Created"] = currentTime.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
@@ -130,7 +130,7 @@ public static OwDocument CreateInstance(WordprocessingDocument pkg)
130130
return new OwDocument(pkg);
131131
}
132132

133-
#region Create OpenXML Word Document Contents Based on Openize.Words.IElements
133+
#region Create OpenXML Word Document Contents Based on FileFormat.Words.IElements
134134

135135
#region Main Method
136136
internal void CreateDocument(List<FF.IElement> lst)
@@ -140,7 +140,7 @@ internal void CreateDocument(List<FF.IElement> lst)
140140
_wpBody = _mainPart.Document.Body;
141141

142142
if (_wpBody == null)
143-
throw new OpenizeException("Package or Document or Body is null", new NullReferenceException());
143+
throw new FileFormat.Words.FileFormatException("Package or Document or Body is null", new NullReferenceException());
144144

145145
var sectionProperties = _wpBody.Elements<WP.SectionProperties>().FirstOrDefault();
146146

@@ -172,7 +172,7 @@ internal void CreateDocument(List<FF.IElement> lst)
172172
catch (Exception ex)
173173
{
174174
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Initialize OOXML Element(s)");
175-
throw new OpenizeException(errorMessage, ex);
175+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
176176
}
177177

178178
}
@@ -434,7 +434,7 @@ internal WP.Paragraph CreateParagraph(FF.Paragraph ffP)
434434
catch (Exception ex)
435435
{
436436
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Create Paragraph");
437-
throw new OpenizeException(errorMessage, ex);
437+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
438438
}
439439
}
440440
}
@@ -551,7 +551,7 @@ internal WP.Table CreateTable(FF.Table ffTable)
551551
catch (Exception ex)
552552
{
553553
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Create Table");
554-
throw new OpenizeException(errorMessage, ex);
554+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
555555
}
556556
}
557557
}
@@ -657,14 +657,14 @@ internal WP.Paragraph CreateImage(FF.Image ffImg, MainDocumentPart mainPart)
657657
catch (Exception ex)
658658
{
659659
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Create Image");
660-
throw new OpenizeException(errorMessage, ex);
660+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
661661
}
662662
}
663663
}
664664
#endregion
665665
#endregion
666666

667-
#region Load OpenXML Word Document Content into Openize.Words.IElements
667+
#region Load OpenXML Word Document Content into FileFormat.Words.IElements
668668

669669
#region Main Method
670670
internal List<FF.IElement> LoadDocument(Stream stream)
@@ -675,7 +675,7 @@ internal WP.Paragraph CreateImage(FF.Image ffImg, MainDocumentPart mainPart)
675675
{
676676
_pkgDocument = WordprocessingDocument.Open(stream, true);
677677

678-
if (_pkgDocument.MainDocumentPart?.Document?.Body == null) throw new OpenizeException("Package or Document or Body is null", new NullReferenceException());
678+
if (_pkgDocument.MainDocumentPart?.Document?.Body == null) throw new FileFormat.Words.FileFormatException("Package or Document or Body is null", new NullReferenceException());
679679

680680
OWD.OoxmlDocData.CreateInstance(_pkgDocument);
681681

@@ -762,7 +762,7 @@ internal WP.Paragraph CreateImage(FF.Image ffImg, MainDocumentPart mainPart)
762762
catch (Exception ex)
763763
{
764764
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Load OOXML Elements");
765-
throw new OpenizeException(errorMessage, ex);
765+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
766766
}
767767
}
768768
}
@@ -887,7 +887,7 @@ internal FF.Paragraph LoadParagraph(WP.Paragraph wpPara, int id)
887887
catch (Exception ex)
888888
{
889889
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Load Paragraph");
890-
throw new OpenizeException(errorMessage, ex);
890+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
891891
}
892892
}
893893
}
@@ -1010,7 +1010,7 @@ internal FF.Image LoadImage(WP.Drawing drawing, int sequence)
10101010
catch (Exception ex)
10111011
{
10121012
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Load Image");
1013-
throw new OpenizeException(errorMessage, ex);
1013+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
10141014
}
10151015
}
10161016
}
@@ -1070,7 +1070,7 @@ internal FF.Table LoadTable(WP.Table wpTable, int id)
10701070
catch (Exception ex)
10711071
{
10721072
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Load Table");
1073-
throw new OpenizeException(errorMessage, ex);
1073+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
10741074
}
10751075
}
10761076
}
@@ -1120,7 +1120,7 @@ internal FF.Section LoadSection(WP.SectionProperties sectPr, int id)
11201120
catch (Exception ex)
11211121
{
11221122
var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Load Section");
1123-
throw new OpenizeException(errorMessage, ex);
1123+
throw new FileFormat.Words.FileFormatException(errorMessage, ex);
11241124
}
11251125
}
11261126
}
@@ -1217,7 +1217,7 @@ internal void SaveDocument(Stream stream)
12171217
catch (Exception ex)
12181218
{
12191219
//var errorMessage = OWD.OoxmlDocData.ConstructMessage(ex, "Save OOXML OWDocument");
1220-
//throw new OpenizeException(errorMessage, ex);
1220+
//throw new FileFormatException(errorMessage, ex);
12211221
throw new Exception(ex.Message);
12221222
}
12231223
}

0 commit comments

Comments
 (0)