Преглед изворни кода

Merge pull request #6 from CPonty/patch-5

#5 : Cleaned up warnings from invalid XML comments
master
PrzemyslawKlys пре 10 година
родитељ
комит
ffb332608d
8 измењених фајлова са 117 додато и 126 уклоњено
  1. 7
    7
      DocX/Container.cs
  2. 9
    16
      DocX/DocX.cs
  3. 1
    0
      DocX/DocX.csproj
  4. 0
    2
      DocX/HelperFunctions.cs
  5. 3
    1
      DocX/Hyperlink.cs
  6. 90
    97
      DocX/Paragraph.cs
  7. 2
    0
      DocX/Picture.cs
  8. 5
    3
      DocX/Table.cs

+ 7
- 7
DocX/Container.cs Прегледај датотеку

/// using (DocX document = DocX.Load(@"Test.docx")) /// using (DocX document = DocX.Load(@"Test.docx"))
/// { /// {
/// // All Paragraphs in this document. /// // All Paragraphs in this document.
/// List<Paragraph> documentParagraphs = document.Paragraphs;
/// <![CDATA[ List<Paragraph> ]]> documentParagraphs = document.Paragraphs;
/// ///
/// // Make sure this document contains at least one Table. /// // Make sure this document contains at least one Table.
/// if (document.Tables.Count() > 0) /// if (document.Tables.Count() > 0)
/// Table t = document.Tables[0]; /// Table t = document.Tables[0];
/// ///
/// // All Paragraphs in this Table. /// // All Paragraphs in this Table.
/// List<Paragraph> tableParagraphs = t.Paragraphs;
/// <![CDATA[ List<Paragraph> ]]> tableParagraphs = t.Paragraphs;
/// ///
/// // Make sure this Table contains at least one Row. /// // Make sure this Table contains at least one Row.
/// if (t.Rows.Count() > 0) /// if (t.Rows.Count() > 0)
/// Row r = t.Rows[0]; /// Row r = t.Rows[0];
/// ///
/// // All Paragraphs in this Row. /// // All Paragraphs in this Row.
/// List<Paragraph> rowParagraphs = r.Paragraphs;
/// <![CDATA[ List<Paragraph> ]]> rowParagraphs = r.Paragraphs;
/// ///
/// // Make sure this Row contains at least one Cell. /// // Make sure this Row contains at least one Cell.
/// if (r.Cells.Count() > 0) /// if (r.Cells.Count() > 0)
/// Cell c = r.Cells[0]; /// Cell c = r.Cells[0];
/// ///
/// // All Paragraphs in this Cell. /// // All Paragraphs in this Cell.
/// List<Paragraph> cellParagraphs = c.Paragraphs;
/// <![CDATA[ List<Paragraph> ]]> cellParagraphs = c.Paragraphs;
/// } /// }
/// } /// }
/// } /// }
return paragraphs.AsReadOnly(); return paragraphs.AsReadOnly();
} }
} }
// <summary>
/// <summary>
/// Removes paragraph at specified position /// Removes paragraph at specified position
/// </summary> /// </summary>
/// <param name="index">Index of paragraph to remove</param> /// <param name="index">Index of paragraph to remove</param>
/// <summary> /// <summary>
/// Removes paragraph /// Removes paragraph
/// </summary> /// </summary>
/// <param name="paragraph">Paragraph to remove</param>
/// <param name="p">Paragraph to remove</param>
/// <returns>True if removed</returns> /// <returns>True if removed</returns>
public bool RemoveParagraph(Paragraph p) public bool RemoveParagraph(Paragraph p)
{ {
/// Find all unique instances of the given Regex Pattern, /// Find all unique instances of the given Regex Pattern,
/// returning the list of the unique strings found /// returning the list of the unique strings found
/// </summary> /// </summary>
/// <param name="str"></param>
/// <param name="pattern"></param>
/// <param name="options"></param> /// <param name="options"></param>
/// <returns></returns> /// <returns></returns>
public virtual List<string> FindUniqueByPattern(string pattern, RegexOptions options) public virtual List<string> FindUniqueByPattern(string pattern, RegexOptions options)

+ 9
- 16
DocX/DocX.cs Прегледај датотеку

/// } /// }
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="AddProtection"/>
/// <seealso cref="AddProtection(EditRestrictions)"/>
/// <seealso cref="RemoveProtection"/> /// <seealso cref="RemoveProtection"/>
/// <seealso cref="GetProtectionType"/> /// <seealso cref="GetProtectionType"/>
public bool isProtected public bool isProtected
/// } /// }
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="AddProtection"/>
/// <seealso cref="AddProtection(EditRestrictions)"/>
/// <seealso cref="RemoveProtection"/> /// <seealso cref="RemoveProtection"/>
/// <seealso cref="isProtected"/> /// <seealso cref="isProtected"/>
public EditRestrictions GetProtectionType() public EditRestrictions GetProtectionType()
/// } /// }
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="AddProtection"/>
/// <seealso cref="AddProtection(EditRestrictions)"/>
/// <seealso cref="GetProtectionType"/> /// <seealso cref="GetProtectionType"/>
/// <seealso cref="isProtected"/> /// <seealso cref="isProtected"/>
public void RemoveProtection() public void RemoveProtection()
/// <summary> /// <summary>
/// Should the Document use different Headers and Footers for odd and even pages? /// Should the Document use different Headers and Footers for odd and even pages?
/// </summary> /// </summary>
/// <example>
/// <code>
/// // Create a document. /// // Create a document.
/// using (DocX document = DocX.Create(@"Test.docx")) /// using (DocX document = DocX.Create(@"Test.docx"))
/// { /// {
/// // Save all changes to this document. /// // Save all changes to this document.
/// document.Save(); /// document.Save();
/// }// Release this document from memory. /// }// Release this document from memory.
/// </code>
/// </example> /// </example>
public bool DifferentOddAndEvenPages public bool DifferentOddAndEvenPages
{ {
/// Creates a document using a Stream. /// Creates a document using a Stream.
/// </summary> /// </summary>
/// <param name="stream">The Stream to create the document from.</param> /// <param name="stream">The Stream to create the document from.</param>
/// <param name="documentType"></param>
/// <returns>Returns a DocX object which represents the document.</returns> /// <returns>Returns a DocX object which represents the document.</returns>
/// <example> /// <example>
/// Creating a document from a FileStream. /// Creating a document from a FileStream.
/// } /// }
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="DocX.Create(string)"/>
/// <seealso cref="DocX.Load(System.IO.Stream)"/> /// <seealso cref="DocX.Load(System.IO.Stream)"/>
/// <seealso cref="DocX.Load(string)"/> /// <seealso cref="DocX.Load(string)"/>
/// <seealso cref="DocX.Save()"/> /// <seealso cref="DocX.Save()"/>
/// Creates a document using a fully qualified or relative filename. /// Creates a document using a fully qualified or relative filename.
/// </summary> /// </summary>
/// <param name="filename">The fully qualified or relative filename.</param> /// <param name="filename">The fully qualified or relative filename.</param>
/// <param name="documentType"></param>
/// <returns>Returns a DocX object which represents the document.</returns> /// <returns>Returns a DocX object which represents the document.</returns>
/// <example> /// <example>
/// <code> /// <code>
/// document.Save(); /// document.Save();
/// }// Release this document from memory /// }// Release this document from memory
/// </code> /// </code>
/// <seealso cref="DocX.Create(System.IO.Stream)"/>
/// <seealso cref="DocX.Load(System.IO.Stream)"/> /// <seealso cref="DocX.Load(System.IO.Stream)"/>
/// <seealso cref="DocX.Load(string)"/> /// <seealso cref="DocX.Load(string)"/>
/// <seealso cref="DocX.Save()"/> /// <seealso cref="DocX.Save()"/>
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="DocX.Load(string)"/> /// <seealso cref="DocX.Load(string)"/>
/// <seealso cref="DocX.Create(System.IO.Stream)"/>
/// <seealso cref="DocX.Create(string)"/>
/// <seealso cref="DocX.Save()"/> /// <seealso cref="DocX.Save()"/>
public static DocX Load(Stream stream) public static DocX Load(Stream stream)
{ {
/// }// Release this document from memory. /// }// Release this document from memory.
/// </code> /// </code>
/// <seealso cref="DocX.Load(System.IO.Stream)"/> /// <seealso cref="DocX.Load(System.IO.Stream)"/>
/// <seealso cref="DocX.Create(System.IO.Stream)"/>
/// <seealso cref="DocX.Create(string)"/>
/// <seealso cref="DocX.Save()"/> /// <seealso cref="DocX.Save()"/>
/// </example> /// </example>
public static DocX Load(string filename) public static DocX Load(string filename)
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="DocX.SaveAs(string)"/> /// <seealso cref="DocX.SaveAs(string)"/>
/// <seealso cref="DocX.Create(System.IO.Stream)"/>
/// <seealso cref="DocX.Create(string)"/>
/// <seealso cref="DocX.Load(System.IO.Stream)"/> /// <seealso cref="DocX.Load(System.IO.Stream)"/>
/// <seealso cref="DocX.Load(string)"/> /// <seealso cref="DocX.Load(string)"/>
/// <!-- /// <!--
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="DocX.Save()"/> /// <seealso cref="DocX.Save()"/>
/// <seealso cref="DocX.Create(System.IO.Stream)"/>
/// <seealso cref="DocX.Create(string)"/>
/// <seealso cref="DocX.Load(System.IO.Stream)"/> /// <seealso cref="DocX.Load(System.IO.Stream)"/>
/// <seealso cref="DocX.Load(string)"/> /// <seealso cref="DocX.Load(string)"/>
public void SaveAs(string filename) public void SaveAs(string filename)
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="DocX.Save()"/> /// <seealso cref="DocX.Save()"/>
/// <seealso cref="DocX.Create(System.IO.Stream)"/>
/// <seealso cref="DocX.Create(string)"/>
/// <seealso cref="DocX.Load(System.IO.Stream)"/> /// <seealso cref="DocX.Load(System.IO.Stream)"/>
/// <seealso cref="DocX.Load(string)"/> /// <seealso cref="DocX.Load(string)"/>
public void SaveAs(Stream stream) public void SaveAs(Stream stream)
} }
/// <summary> /// <summary>
/// Inserts at TOC into the current document before the provided <see cref="reference"/>
/// Inserts at TOC into the current document before the provided <paramref name="reference"/>
/// </summary> /// </summary>
/// <param name="reference">The paragraph to use as reference</param> /// <param name="reference">The paragraph to use as reference</param>
/// <param name="title">The title of the TOC</param> /// <param name="title">The title of the TOC</param>

+ 1
- 0
DocX/DocX.csproj Прегледај датотеку

<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\DocX.XML</DocumentationFile> <DocumentationFile>bin\Debug\DocX.XML</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<NoWarn>CS1591</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

+ 0
- 2
DocX/HelperFunctions.cs Прегледај датотеку

/// when the default bullet, numbered and multilevel lists are added to a blank document /// when the default bullet, numbered and multilevel lists are added to a blank document
/// </summary> /// </summary>
/// <param name="package"></param> /// <param name="package"></param>
/// <param name="mainDocumentPart"></param>
/// <returns></returns> /// <returns></returns>
internal static XDocument AddDefaultNumberingXml(Package package) internal static XDocument AddDefaultNumberingXml(Package package)
{ {
/// If this document does not contain a /word/styles.xml add the default one generated by Microsoft Word. /// If this document does not contain a /word/styles.xml add the default one generated by Microsoft Word.
/// </summary> /// </summary>
/// <param name="package"></param> /// <param name="package"></param>
/// <param name="mainDocumentPart"></param>
/// <returns></returns> /// <returns></returns>
internal static XDocument AddDefaultStylesXml(Package package) internal static XDocument AddDefaultStylesXml(Package package)
{ {

+ 3
- 1
DocX/Hyperlink.cs Прегледај датотеку

/// using (DocX document = DocX.Load(@"Test.docx")) /// using (DocX document = DocX.Load(@"Test.docx"))
/// { /// {
/// // Get all of the hyperlinks in this document /// // Get all of the hyperlinks in this document
/// List<Hyperlink> hyperlinks = document.Hyperlinks;
/// List&lt;Hyperlink&gt; hyperlinks = document.Hyperlinks;
/// ///
/// // Change the first hyperlinks text and Uri /// // Change the first hyperlinks text and Uri
/// Hyperlink h0 = hyperlinks[0]; /// Hyperlink h0 = hyperlinks[0];
/// <example> /// <example>
/// Change the Uri of a Hyperlink. /// Change the Uri of a Hyperlink.
/// <code> /// <code>
/// <![CDATA[
/// // Create a document. /// // Create a document.
/// using (DocX document = DocX.Load(@"Test.docx")) /// using (DocX document = DocX.Load(@"Test.docx"))
/// { /// {
/// // Save this document. /// // Save this document.
/// document.Save(); /// document.Save();
/// } /// }
/// ]]>
/// </code> /// </code>
/// </example> /// </example>
public Uri Uri public Uri Uri

+ 90
- 97
DocX/Paragraph.cs Прегледај датотеку

/// <example> /// <example>
/// Returns a list of all Pictures in a Paragraph. /// Returns a list of all Pictures in a Paragraph.
/// <code> /// <code>
/// <![CDATA[
/// // Create a document. /// // Create a document.
/// using (DocX document = DocX.Load(@"Test.docx")) /// using (DocX document = DocX.Load(@"Test.docx"))
/// { /// {
/// // Save this document. /// // Save this document.
/// document.Save(); /// document.Save();
/// } /// }
/// ]]>
/// </code> /// </code>
/// </example> /// </example>
public List<Picture> Pictures public List<Picture> Pictures
/// Paragraph p = document.Paragraphs[0]; /// Paragraph p = document.Paragraphs[0];
/// ///
/// // Get all of the hyperlinks in this Paragraph. /// // Get all of the hyperlinks in this Paragraph.
/// List<Hyperlink> hyperlinks = paragraph.Hyperlinks;
/// <![CDATA[ List<Hyperlink> ]]> hyperlinks = paragraph.Hyperlinks;
/// ///
/// // Change the first hyperlinks text and Uri /// // Change the first hyperlinks text and Uri
/// Hyperlink h0 = hyperlinks[0]; /// Hyperlink h0 = hyperlinks[0];
// return newPicture; // return newPicture;
//} //}
/// <summary>
/// Insert a Picture at the end of this paragraph.
/// </summary>
/// <param name="description">A string to describe this Picture.</param>
/// <param name="imageID">The unique id that identifies the Image this Picture represents.</param>
/// <param name="name">The name of this image.</param>
/// <returns>A Picture.</returns>
/// <example>
/// <code>
/// // Create a document using a relative filename.
/// using (DocX document = DocX.Create(@"Test.docx"))
/// {
/// // Add a new Paragraph to this document.
/// Paragraph p = document.InsertParagraph("Here is Picture 1", false);
///
/// // Add an Image to this document.
/// Novacode.Image img = document.AddImage(@"Image.jpg");
///
/// // Insert pic at the end of Paragraph p.
/// Picture pic = p.InsertPicture(img.Id, "Photo 31415", "A pie I baked.");
///
/// // Rotate the Picture clockwise by 30 degrees.
/// pic.Rotation = 30;
///
/// // Resize the Picture.
/// pic.Width = 400;
/// pic.Height = 300;
///
/// // Set the shape of this Picture to be a cube.
/// pic.SetPictureShape(BasicShapes.cube);
///
/// // Flip the Picture Horizontally.
/// pic.FlipHorizontal = true;
///
/// // Save all changes made to this document.
/// document.Save();
/// }// Release this document from memory.
/// </code>
/// </example>
/// Removed to simplify the API.
// <summary>
// Insert a Picture at the end of this paragraph.
// </summary>
// <param name="description">A string to describe this Picture.</param>
// <param name="imageID">The unique id that identifies the Image this Picture represents.</param>
// <param name="name">The name of this image.</param>
// <returns>A Picture.</returns>
// <example>
// <code>
// // Create a document using a relative filename.
// using (DocX document = DocX.Create(@"Test.docx"))
// {
// // Add a new Paragraph to this document.
// Paragraph p = document.InsertParagraph("Here is Picture 1", false);
//
// // Add an Image to this document.
// Novacode.Image img = document.AddImage(@"Image.jpg");
//
// // Insert pic at the end of Paragraph p.
// Picture pic = p.InsertPicture(img.Id, "Photo 31415", "A pie I baked.");
//
// // Rotate the Picture clockwise by 30 degrees.
// pic.Rotation = 30;
//
// // Resize the Picture.
// pic.Width = 400;
// pic.Height = 300;
//
// // Set the shape of this Picture to be a cube.
// pic.SetPictureShape(BasicShapes.cube);
//
// // Flip the Picture Horizontally.
// pic.FlipHorizontal = true;
//
// // Save all changes made to this document.
// document.Save();
// }// Release this document from memory.
// </code>
// </example>
// Removed to simplify the API.
//public Picture InsertPicture(string imageID, string name, string description) //public Picture InsertPicture(string imageID, string name, string description)
//{ //{
// Picture p = CreatePicture(Document, imageID, name, description); // Picture p = CreatePicture(Document, imageID, name, description);
// return p; // return p;
//} //}
/// <summary>
/// Insert a Picture into this Paragraph at a specified index.
/// </summary>
/// <param name="description">A string to describe this Picture.</param>
/// <param name="imageID">The unique id that identifies the Image this Picture represents.</param>
/// <param name="name">The name of this image.</param>
/// <param name="index">The index to insert this Picture at.</param>
/// <returns>A Picture.</returns>
/// <example>
/// <code>
/// // Create a document using a relative filename.
/// using (DocX document = DocX.Create(@"Test.docx"))
/// {
/// // Add a new Paragraph to this document.
/// Paragraph p = document.InsertParagraph("Here is Picture 1", false);
///
/// // Add an Image to this document.
/// Novacode.Image img = document.AddImage(@"Image.jpg");
///
/// // Insert pic at the start of Paragraph p.
/// Picture pic = p.InsertPicture(0, img.Id, "Photo 31415", "A pie I baked.");
///
/// // Rotate the Picture clockwise by 30 degrees.
/// pic.Rotation = 30;
///
/// // Resize the Picture.
/// pic.Width = 400;
/// pic.Height = 300;
///
/// // Set the shape of this Picture to be a cube.
/// pic.SetPictureShape(BasicShapes.cube);
///
/// // Flip the Picture Horizontally.
/// pic.FlipHorizontal = true;
///
/// // Save all changes made to this document.
/// document.Save();
/// }// Release this document from memory.
/// </code>
/// </example>
/// Removed to simplify API.
// <summary>
// Insert a Picture into this Paragraph at a specified index.
// </summary>
// <param name="description">A string to describe this Picture.</param>
// <param name="imageID">The unique id that identifies the Image this Picture represents.</param>
// <param name="name">The name of this image.</param>
// <param name="index">The index to insert this Picture at.</param>
// <returns>A Picture.</returns>
// <example>
// <code>
// // Create a document using a relative filename.
// using (DocX document = DocX.Create(@"Test.docx"))
// {
// // Add a new Paragraph to this document.
// Paragraph p = document.InsertParagraph("Here is Picture 1", false);
//
// // Add an Image to this document.
// Novacode.Image img = document.AddImage(@"Image.jpg");
//
// // Insert pic at the start of Paragraph p.
// Picture pic = p.InsertPicture(0, img.Id, "Photo 31415", "A pie I baked.");
//
// // Rotate the Picture clockwise by 30 degrees.
// pic.Rotation = 30;
//
// // Resize the Picture.
// pic.Width = 400;
// pic.Height = 300;
//
// // Set the shape of this Picture to be a cube.
// pic.SetPictureShape(BasicShapes.cube);
//
// // Flip the Picture Horizontally.
// pic.FlipHorizontal = true;
//
// // Save all changes made to this document.
// document.Save();
// }// Release this document from memory.
// </code>
// </example>
// Removed to simplify API.
//public Picture InsertPicture(int index, string imageID, string name, string description) //public Picture InsertPicture(int index, string imageID, string name, string description)
//{ //{
// Picture picture = CreatePicture(Document, imageID, name, description); // Picture picture = CreatePicture(Document, imageID, name, description);
/// <summary> /// <summary>
/// Create a new Picture. /// Create a new Picture.
/// </summary> /// </summary>
/// <param name="document"></param>
/// <param name="id">A unique id that identifies an Image embedded in this document.</param> /// <param name="id">A unique id that identifies an Image embedded in this document.</param>
/// <param name="name">The name of this Picture.</param> /// <param name="name">The name of this Picture.</param>
/// <param name="descr">The description of this Picture.</param> /// <param name="descr">The description of this Picture.</param>
/// </example> /// </example>
/// <seealso cref="Paragraph.RemoveText(int, bool)"/> /// <seealso cref="Paragraph.RemoveText(int, bool)"/>
/// <seealso cref="Paragraph.RemoveText(int, int, bool)"/> /// <seealso cref="Paragraph.RemoveText(int, int, bool)"/>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool)"/>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool, RegexOptions)"/>
/// <param name="value">The System.String to insert.</param> /// <param name="value">The System.String to insert.</param>
/// <param name="trackChanges">Flag this insert as a change.</param> /// <param name="trackChanges">Flag this insert as a change.</param>
/// <param name="formatting">The text formatting.</param> /// <param name="formatting">The text formatting.</param>
/// </example> /// </example>
/// <seealso cref="Paragraph.RemoveText(int, bool)"/> /// <seealso cref="Paragraph.RemoveText(int, bool)"/>
/// <seealso cref="Paragraph.RemoveText(int, int, bool)"/> /// <seealso cref="Paragraph.RemoveText(int, int, bool)"/>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool)"/>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool, RegexOptions)"/>
/// <param name="index">The index position of the insertion.</param> /// <param name="index">The index position of the insertion.</param>
/// <param name="value">The System.String to insert.</param> /// <param name="value">The System.String to insert.</param>
/// <param name="trackChanges">Flag this insert as a change.</param> /// <param name="trackChanges">Flag this insert as a change.</param>
/// Append a field of type document property, this field will display the custom property cp, at the end of this paragraph. /// Append a field of type document property, this field will display the custom property cp, at the end of this paragraph.
/// </summary> /// </summary>
/// <param name="cp">The custom property to display.</param> /// <param name="cp">The custom property to display.</param>
/// <param name="trackChanges"></param>
/// <param name="f">The formatting to use for this text.</param> /// <param name="f">The formatting to use for this text.</param>
/// <example> /// <example>
/// Create, add and display a custom property in a document. /// Create, add and display a custom property in a document.
/// <code> /// <code>
///// Load a document.
/// // Load a document.
///using (DocX document = DocX.Create("CustomProperty_Add.docx")) ///using (DocX document = DocX.Create("CustomProperty_Add.docx"))
///{ ///{
/// // Add a few Custom Properties to this document. /// // Add a few Custom Properties to this document.
/// Insert a field of type document property, this field will display the custom property cp, at the end of this paragraph. /// Insert a field of type document property, this field will display the custom property cp, at the end of this paragraph.
/// </summary> /// </summary>
/// <param name="cp">The custom property to display.</param> /// <param name="cp">The custom property to display.</param>
/// <param name="trackChanges"></param>
/// <param name="f">The formatting to use for this text.</param> /// <param name="f">The formatting to use for this text.</param>
/// <example> /// <example>
/// Create, add and display a custom property in a document. /// Create, add and display a custom property in a document.
/// }// Release this document from memory. /// }// Release this document from memory.
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool)"/>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool, RegexOptions)"/>
/// <seealso cref="Paragraph.InsertText(string, bool)"/>
/// <seealso cref="Paragraph.InsertText(int, string, bool)"/>
/// <seealso cref="Paragraph.InsertText(int, string, bool, Formatting)"/> /// <seealso cref="Paragraph.InsertText(int, string, bool, Formatting)"/>
/// <seealso cref="Paragraph.InsertText(string, bool, Formatting)"/> /// <seealso cref="Paragraph.InsertText(string, bool, Formatting)"/>
/// <param name="index">The position to begin deleting characters.</param> /// <param name="index">The position to begin deleting characters.</param>
/// }// Release this document from memory. /// }// Release this document from memory.
/// </code> /// </code>
/// </example> /// </example>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool)"/>
/// <seealso cref="Paragraph.ReplaceText(string, string, bool, RegexOptions)"/>
/// <seealso cref="Paragraph.InsertText(int, string, bool, Formatting)"/> /// <seealso cref="Paragraph.InsertText(int, string, bool, Formatting)"/>
/// <seealso cref="Paragraph.InsertText(string, bool, Formatting)"/> /// <seealso cref="Paragraph.InsertText(string, bool, Formatting)"/>
/// <param name="index">The position to begin deleting characters.</param> /// <param name="index">The position to begin deleting characters.</param>
/// </example> /// </example>
/// <seealso cref="Paragraph.RemoveText(int, int, bool)"/> /// <seealso cref="Paragraph.RemoveText(int, int, bool)"/>
/// <seealso cref="Paragraph.RemoveText(int, bool)"/> /// <seealso cref="Paragraph.RemoveText(int, bool)"/>
/// <seealso cref="Paragraph.InsertText(string, bool)"/>
/// <seealso cref="Paragraph.InsertText(int, string, bool)"/>
/// <seealso cref="Paragraph.InsertText(int, string, bool, Formatting)"/> /// <seealso cref="Paragraph.InsertText(int, string, bool, Formatting)"/>
/// <seealso cref="Paragraph.InsertText(string, bool, Formatting)"/> /// <seealso cref="Paragraph.InsertText(string, bool, Formatting)"/>
/// <param name="newValue">A System.String to replace all occurances of oldValue.</param> /// <param name="newValue">A System.String to replace all occurances of oldValue.</param>
/// foreach(Paragraph p in document.Paragraphs) /// foreach(Paragraph p in document.Paragraphs)
/// { /// {
/// // Find all instances of 'go' in this paragraph. /// // Find all instances of 'go' in this paragraph.
/// List&lt;int&gt; gos = document.FindAll("go");
/// <![CDATA[ List<int> ]]> gos = document.FindAll("go");
/// ///
/// /* /// /*
/// * Insert 'don't' in frount of every instance of 'go' in this document to produce 'don't go'. /// * Insert 'don't' in frount of every instance of 'go' in this document to produce 'don't go'.
/// foreach(Paragraph p in document.Paragraphs) /// foreach(Paragraph p in document.Paragraphs)
/// { /// {
/// // Find all instances of 'go' in this paragraph (Ignore case). /// // Find all instances of 'go' in this paragraph (Ignore case).
/// List&lt;int&gt; gos = document.FindAll("go", RegexOptions.IgnoreCase);
/// <![CDATA[ List<int> ]]> gos = document.FindAll("go", RegexOptions.IgnoreCase);
/// ///
/// /* /// /*
/// * Insert 'don't' in frount of every instance of 'go' in this document to produce 'don't go'. /// * Insert 'don't' in frount of every instance of 'go' in this document to produce 'don't go'.

+ 2
- 0
DocX/Picture.cs Прегледај датотеку

/// <summary> /// <summary>
/// Wraps an XElement as an Image /// Wraps an XElement as an Image
/// </summary> /// </summary>
/// <param name="document"></param>
/// <param name="i">The XElement i to wrap</param> /// <param name="i">The XElement i to wrap</param>
/// <param name="img"></param>
internal Picture(DocX document, XElement i, Image img):base(document, i) internal Picture(DocX document, XElement i, Image img):base(document, i)
{ {
picture_rels = new Dictionary<PackagePart, PackageRelationship>(); picture_rels = new Dictionary<PackagePart, PackageRelationship>();

+ 5
- 3
DocX/Table.cs Прегледај датотеку

/// <example> /// <example>
/// Returns a list of all Pictures in a Table. /// Returns a list of all Pictures in a Table.
/// <code> /// <code>
/// <![CDATA[
/// // Create a document. /// // Create a document.
/// using (DocX document = DocX.Load(@"Test.docx")) /// using (DocX document = DocX.Load(@"Test.docx"))
/// { /// {
/// // Save this document. /// // Save this document.
/// document.Save(); /// document.Save();
/// } /// }
/// ]]>
/// </code> /// </code>
/// </example> /// </example>
public List<Picture> Pictures public List<Picture> Pictures
/// Table t = document.Tables[0]; /// Table t = document.Tables[0];
/// ///
/// // Get a list of all Hyperlinks in this Table. /// // Get a list of all Hyperlinks in this Table.
/// List<Hyperlink> hyperlinks = t.Hyperlinks;
/// List&lt;Hyperlink&gt; hyperlinks = t.Hyperlinks;
/// ///
/// // Save this document. /// // Save this document.
/// document.Save(); /// document.Save();
/// <example> /// <example>
/// Creates a table with 3 cells and sets the vertical alignment of each to 1 of the 3 available options. /// Creates a table with 3 cells and sets the vertical alignment of each to 1 of the 3 available options.
/// <code> /// <code>
///// Create a new document.
/// // Create a new document.
///using(DocX document = DocX.Create("Test.docx")) ///using(DocX document = DocX.Create("Test.docx"))
///{ ///{
/// // Insert a Table into this document. /// // Insert a Table into this document.
/// </summary> /// </summary>
/// <example> /// <example>
/// <code> /// <code>
///// Create a new document.
/// // Create a new document.
///using (DocX document = DocX.Create("Test.docx")) ///using (DocX document = DocX.Create("Test.docx"))
///{ ///{
/// // Insert a table into this document. /// // Insert a table into this document.

Loading…
Откажи
Сачувај