firstly we have to take data access layer for interact with database
next we are going to business logic layer for interact with DAL
next interact with ASPX page of ur actual UI design page
DAL -->BLL -->UI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
private static string ConvertRtfToXaml(string rtfText)
{
var
richTextBox = new RichTextBox();
if (string.IsNullOrEmpty(rtfText))
return "";
var
textRange = new TextRange(richTextBox.Document.ContentStart,
richTextBox.Document.ContentEnd);
using (var
rtfMemoryStream = new MemoryStream())
{
using (var
rtfStreamWriter = new StreamWriter(rtfMemoryStream))
{
rtfStreamWriter.Write(rtfText);
rtfStreamWriter.Flush();
rtfMemoryStream.Seek(0,
SeekOrigin.Begin);
textRange.Load(rtfMemoryStream,
DataFormats.Rtf);
}
}
using (var
rtfMemoryStream = new MemoryStream())
{
textRange
= new TextRange(richTextBox.Document.ContentStart,
richTextBox.Document.ContentEnd);
textRange.Save(rtfMemoryStream,
DataFormats.Xaml);
rtfMemoryStream.Seek(0,
SeekOrigin.Begin);
using (var
rtfStreamReader = new StreamReader(rtfMemoryStream))
{
return rtfStreamReader.ReadToEnd();
}
}
}
|