Esempio n. 1
0
 private void SaveChanges(SearchResult rezult, FlowDocument document)
 {
     FileWorkerManager.Do(document, rezult.Path);
     //using (var stream = new FileStream(rezult.Path, FileMode.Open))
     //{
     //    new TextRange(document.ContentStart, document.ContentEnd).Save(stream, DataFormats.Rtf);
     //}
 }
Esempio n. 2
0
        private FlowDocument LoadFile(string path)
        {
            FlowDocument document = new FlowDocument();

            FileWorkerManager.Do(document, path, false);
            //using (var stream = new FileStream(path, FileMode.Open))
            //{
            //    var range = new TextRange(document.ContentStart, document.ContentEnd);
            //    range.Load(stream, DataFormats.Rtf);
            //}
            return(document);
        }
Esempio n. 3
0
 private void DoListen()
 {
     while (isAlive)
     {
         if (l.Count > 0)
         {
             Lock.Wait();
             List.SynchronizeTo(l[0], MainList);
             FileWorkerManager.DoAsync(Document, FilePath, Lock);
             l.RemoveAt(0);
         }
     }
 }
Esempio n. 4
0
 public void Init()
 {
     TextBoxAuthor.Text     = project.Author;
     TextBoxTitle.Text      = project.Name;
     ExportTextBox.Document = new FlowDocument();
     foreach (var doc in project.Files)
     {
         FlowDocument paragraph = new FlowDocument();
         //using (var fStream = new FileStream(doc.Path, FileMode.OpenOrCreate, FileAccess.Read))
         //{
         try
         {
             FileWorkerManager.Do(paragraph, doc.Path, false);
             //  new TextRange(paragraph.ContentStart, paragraph.ContentEnd).Load(fStream, System.Windows.DataFormats.Rtf);
         }
         catch (Exception ex)
         {
             System.Windows.MessageBox.Show(ex.Message);
             return;
         }
         //   }
         ExportTextBox.Document.Blocks.AddRange(paragraph.Blocks.ToList());
     }
 }