static void Document_DocumentSaved(object sender, SaveDocumentEventArgs e) { if (isForcingNewVersion) { LockDocument(e.Document); } }
private void OnDocumentNewVersionSavingToWs(SaveDocumentEventArgs obj) { var target = CTPTarget.Create(obj.Document); var ctpLink = GetById(target.TargetId); if (ctpLink != null) { ctpLink.CTP.GoToSavingState(); } }
virtual public void SaveDocument() { var args = new SaveDocumentEventArgs { FileName = DocumentFileName, Modified = IsDocumentModified }; OnSaveDocument?.Invoke(this, args); }
private void OnDocumentNewVersionSavedToWs(SaveDocumentEventArgs obj) { var target = CTPTarget.Create(obj.Document); target.SetWsVersionId(obj.VersionId); var ctpLink = GetById(target.TargetId); if (ctpLink != null) { ctpLink.CTP.SetVersionId(obj.VersionId); } }
public void OnFileShared(SaveDocumentEventArgs e) { if (e.Exception == null) { _notificationManager.OnFileShared(e.File); } else { _notificationManager.OnSavingError(e.Exception); } }
virtual public bool NewDocument(string fileName = "") { bool handled = true; if (isDocumentModified /* && documentFileName != string.Empty*/) { if (OnNewDocumentPrompt != null) { var newPromptArgs = new NewDocumentSavePromptEventArgs(); OnNewDocumentPrompt(this, newPromptArgs); switch (newPromptArgs.DialogResult) { case System.Windows.Forms.DialogResult.Cancel: return(false); case System.Windows.Forms.DialogResult.No: break; case System.Windows.Forms.DialogResult.Yes: var saveArgs = new SaveDocumentEventArgs { FileName = documentFileName }; OnSaveDocument?.Invoke(this, saveArgs); handled = saveArgs.Handled; break; default: break; } } } if (handled && OnNewDocument != null) { var args = new NewDocumentEventArgs { FileName = fileName, Handled = false }; OnNewDocument(this, args); if (args.Handled) { DocumentFileName = args.FileName; IsDocumentModified = false; return(true); } else { return(false); } } else { return(false); } }
private void OnDocumentSavingToWs(SaveDocumentEventArgs obj) { var target = CTPTarget.Create(obj.Document); var targetId = target.TargetId; var ctpLink = GetById(targetId); if (ctpLink != null) { ctpLink.CTP.GoToSavingState(); } else { ctpLink = AddPane(target, target.GetWsVersionId()); ctpLink.CTP.Show(); ctpLink.CTP.GoToSavingState(); } }
private void OnDocumentSharedToWs(SaveDocumentEventArgs obj) { var target = CTPTarget.Create(obj.Document); if (obj.Exception == null) { target.SetWsVersionId(obj.VersionId); var ctpLink = GetById(target.TargetId); if (ctpLink != null) { ctpLink.CTP.SetVersionId(obj.VersionId); ctpLink.CTP.Show(); } } else { var ctpLink = GetById(target.TargetId); if (ctpLink != null) { ctpLink.CTP.OnError(obj.Exception); } } }