コード例 #1
0
 static void Document_DocumentSaved(object sender, SaveDocumentEventArgs e)
 {
     if (isForcingNewVersion)
     {
         LockDocument(e.Document);
     }
 }
コード例 #2
0
ファイル: TaskPaneManager.cs プロジェクト: killbug2004/WSProf
 private void OnDocumentNewVersionSavingToWs(SaveDocumentEventArgs obj)
 {
     var target = CTPTarget.Create(obj.Document);
     var ctpLink = GetById(target.TargetId);
     if (ctpLink != null)
     {
         ctpLink.CTP.GoToSavingState();
     }
 }
コード例 #3
0
ファイル: Document.cs プロジェクト: dogancoruh/QuantumBuilder
        virtual public void SaveDocument()
        {
            var args = new SaveDocumentEventArgs
            {
                FileName = DocumentFileName,
                Modified = IsDocumentModified
            };

            OnSaveDocument?.Invoke(this, args);
        }
コード例 #4
0
ファイル: TaskPaneManager.cs プロジェクト: killbug2004/WSProf
 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);
     }
 }
コード例 #5
0
ファイル: TheRibbon.cs プロジェクト: killbug2004/WSProf
 public void OnFileShared(SaveDocumentEventArgs e)
 {
     if (e.Exception == null)
     {
         _notificationManager.OnFileShared(e.File);
     }
     else
     {
         _notificationManager.OnSavingError(e.Exception);
     }
 }
コード例 #6
0
ファイル: Document.cs プロジェクト: dogancoruh/QuantumBuilder
        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);
            }
        }
コード例 #7
0
ファイル: TaskPaneManager.cs プロジェクト: killbug2004/WSProf
 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();
     }
 }
コード例 #8
0
ファイル: TaskPaneManager.cs プロジェクト: killbug2004/WSProf
        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);
                }
            }
        }