virtual public bool OpenDocument(string fileName) { if (isDocumentModified && documentFileName != string.Empty) { if (OnOpenDocumentPrompt != null) { ProjectOpenPromptEventArgs args = new ProjectOpenPromptEventArgs(); OnOpenDocumentPrompt(this, args); } } if (OnOpenDocument != null) { DocumentOpenEventArgs args = new DocumentOpenEventArgs(); OnOpenDocument(this, args); DocumentFileName = fileName; IsDocumentModified = false; return(true); } else { return(false); } }
virtual public bool OpenDocument() { if (isDocumentModified && documentFileName != string.Empty) { if (OnOpenDocumentPrompt != null) { ProjectOpenPromptEventArgs args = new ProjectOpenPromptEventArgs(); OnOpenDocumentPrompt(this, args); if (!args.IsHandled) { return(false); } } } if (OnOpenDocument != null) { DocumentOpenEventArgs args = new DocumentOpenEventArgs(); args.isHandled = false; OnOpenDocument(this, args); if (args.isHandled) { return(true); } else { return(false); } } else { return(false); } }