public void FileOpenInCollectionAndWindow() { FlowDocumentBox doc = FileSystemDialogMethods.FileOpenFlowDoc(); if (!doc.DocumentPathInFileSystem.Equals(String.Empty)) { FlowDocumentBox inCollectionExist = null; foreach (FlowDocumentBox box in FlowDocumentsBoxes) { if (box.DocumentPathInFileSystem.Equals(doc.DocumentPathInFileSystem)) { inCollectionExist = box; break; } } if (inCollectionExist == null) { FlowDocumentsBoxes.Add(doc); SelectedDocumentBox = doc; } else { SelectedDocumentBox = inCollectionExist; } } }
public void FileNewInCollectionAndWindow() { FlowDocumentBox newDoc = new FlowDocumentBox(new FlowDocument(), "NewFile"); FlowDocumentsBoxes.Add(newDoc); SelectedDocumentBox = newDoc; }
public ButtonForFlowDoc(FlowDocumentBox doc) { InitializeComponent(); FlowDocBox = doc; string[] name = doc.DocumentPathInFileSystem.Split(new char[] { '\\' }); ButtonFileName.Content = name[name.Length - 1]; FlowDocBox.ButtonToManipulateDoc = this; }
public void FileSaveAsCollectionAndWindow() { FlowDocumentBox doc = FileSystemDialogMethods.SaveFileAsFlowDoc(SelectedDocumentBox.Document); if (!doc.DocumentPathInFileSystem.Equals(String.Empty)) { doc.ButtonToManipulateDoc = SelectedDocumentBox.ButtonToManipulateDoc; string[] name = doc.DocumentPathInFileSystem.Split(new char[] { '\\' }); doc.ButtonToManipulateDoc.ButtonFileName.Content = name[name.Length - 1];; SelectedDocumentBox = doc; } }