-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d9b057
commit e86868d
Showing
12 changed files
with
318 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.IO; | ||
using System.Text; | ||
using ApiExamples; | ||
using Aspose.Words.Loading; | ||
using NUnit.Framework; | ||
|
||
namespace Aspose.Words.ApiExamples | ||
{ | ||
class ExMarkdownLoadOptions : ApiExampleBase | ||
{ | ||
[Test] | ||
public void PreserveEmptyLines() | ||
{ | ||
//ExStart:PreserveEmptyLines | ||
//GistId:a775441ecb396eea917a2717cb9e8f8f | ||
//ExFor:MarkdownLoadOptions | ||
//ExFor:MarkdownLoadOptions.PreserveEmptyLines | ||
//ExSummary:Shows how to preserve empty line while load a document. | ||
string mdText = $"{Environment.NewLine}Line1{Environment.NewLine}{Environment.NewLine}Line2{Environment.NewLine}{Environment.NewLine}"; | ||
using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(mdText))) | ||
{ | ||
MarkdownLoadOptions loadOptions = new MarkdownLoadOptions() { PreserveEmptyLines = true }; | ||
Document doc = new Document(stream, loadOptions); | ||
|
||
Assert.AreEqual("\rLine1\r\rLine2\r\f", doc.GetText()); | ||
} | ||
//ExEnd:PreserveEmptyLines | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Examples/ApiExamples/ApiExamples/TestData/TestClasses/ShareQuoteTestClass.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Aspose.Words.ApiExamples.HelperClasses.TestClasses | ||
{ | ||
public class ShareQuoteTestClass | ||
{ | ||
internal ShareQuoteTestClass(int date, int volume, double open, double high, double low, double close) | ||
{ | ||
this.Date = date; | ||
this.Volume = volume; | ||
this.Open = open; | ||
this.High = high; | ||
this.Low = low; | ||
this.Close = close; | ||
} | ||
|
||
public string Color() | ||
{ | ||
return (Open < Close) ? "#1B9629" : "#96002C"; | ||
} | ||
|
||
public int Date; | ||
public int Volume; | ||
public double Open; | ||
public double High; | ||
public double Low; | ||
public double Close; | ||
} | ||
} |
Oops, something went wrong.