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
textControl1.Tables.Add(9, 9, 10); | |
Table table = textControl1.Tables.GetItem(10); | |
table.Select(2, 2, 4, 6); | |
FormatSelectedTableCells(new TableCellFormat() | |
{ | |
BackColor = Color.LightGray, | |
BottomBorderWidth = 1, | |
}); |
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
textControl1.Tables.Add(9, 9, 10); | |
Table table = textControl1.Tables.GetItem(10); | |
table.Select(2, 2, 4, 6); |
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
private void FormatSelectedTableCells(TableCellFormat cellFormat) | |
{ | |
Table table = textControl1.Tables.GetItem(); | |
if (table == null) | |
return; | |
Selection curSelection = new Selection( | |
textControl1.Selection.Start, | |
textControl1.Selection.Length); |
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
string url = "https://www.textcontrol.com/img/corporate_id/tx_logo.svg"; | |
using (WebClient client = new WebClient()) | |
{ | |
byte[] bytes = client.DownloadData(url); | |
using (MemoryStream ms = new MemoryStream( | |
bytes, 0, bytes.Length, writable: false, publiclyVisible: true)) | |
{ | |
// create image object |
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
string imagePath = "Images/signature1.jpg"; | |
byte[] bytes = File.ReadAllBytes(imagePath); | |
using (MemoryStream ms = new MemoryStream( | |
bytes, 0, bytes.Length, writable: false, publiclyVisible: true)) | |
{ | |
// create image object | |
TXTextControl.Image myImage = new TXTextControl.Image(ms); | |
textControl1.Images.Add(myImage, -1); |
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
string imagePath = "Images/signature1.jpg"; | |
// load image into memory stream | |
MemoryStream ms = new MemoryStream(); | |
Image img = Image.FromFile(imagePath); | |
img.Save(ms, img.RawFormat); | |
// create image object | |
TXTextControl.Image myImage = new TXTextControl.Image(ms); |
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
string imagePath = "Images/signature1.jpg"; | |
System.Drawing.Image img = System.Drawing.Image.FromFile(imagePath); | |
TXTextControl.Image myImage = new TXTextControl.Image(img); | |
textControl1.Images.Add(myImage, -1); |
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
string imagePath = "Images/signature1.jpg"; | |
TXTextControl.Image myImage = new TXTextControl.Image() { | |
FileName = imagePath }; | |
textControl1.Images.Add(myImage, -1); |
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
public DocumentComparison(TXTextControl.TextControl originalDocument, TextControl revisedDocument) | |
{ | |
// Initialize document references | |
m_originalDocument = originalDocument; | |
m_revisedDocument = revisedDocument; | |
// Enable track changes in the original document | |
originalDocument.IsTrackChangesEnabled = true; | |
// Compare paragraphs between the original and revised documents |
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
private static List<(string word, int charIndex, string replacedWord)> CompareSentences(string sentence1, string sentence2) | |
{ | |
string[] words1 = sentence1.Split(' '); | |
string[] words2 = sentence2.Split(' '); | |
List<(string word, int charIndex, string replacedWord)> differences = | |
new List<(string word, int charIndex, string replacedWord)>(); | |
// Track the character index | |
int charIndex = 0; |
NewerOlder