public override Document OpenProjectItem(DocumentProjectItem item, bool readOnly, DocumentViewType initialView) { IDocumentManager service = (IDocumentManager) base.GetService(typeof(IDocumentManager)); if (service == null) { return null; } MiscFileProjectItem projectItem = item as MiscFileProjectItem; if (projectItem == null) { projectItem = new MiscFileProjectItem(item.Caption, item.Path, this); } return service.OpenDocument(projectItem, readOnly, initialView); }
public override DocumentProjectItem GetSaveAsProjectItem(DocumentProjectItem item) { DocumentProjectItem item2 = null; PromptDialog dialog = new PromptDialog(base.ServiceProvider); dialog.Text = "Save Document As"; dialog.EntryText = "Enter the full path to the new FTP location for the document:\n"; dialog.EntryValue = item.Path; dialog.RequiresNewValue = true; ICommandManager service = (ICommandManager) base.GetService(typeof(ICommandManager)); if (service != null) { service.SuspendCommandUpdate(); } try { if (dialog.ShowDialog() != DialogResult.OK) { return item2; } string entryValue = dialog.EntryValue; if (!this.ValidateProjectItemPath(entryValue, false)) { throw new Exception("'" + entryValue + "' is not a valid file path."); } string caption = entryValue; int num = entryValue.LastIndexOf('/'); if (num > 0) { caption = entryValue.Substring(num + 1); } item2 = new MiscFileProjectItem(caption, entryValue, this); } finally { if (service != null) { service.ResumeCommandUpdate(); } } return item2; }