コード例 #1
0
ファイル: Document.cs プロジェクト: dogancoruh/QuantumBuilder
        virtual public void SaveAsDocument()
        {
            string fileName_ = string.Empty;

            if (isDocumentModified && documentFileName != string.Empty)
            {
                if (OnSaveAsDocumentPrompt != null)
                {
                    var args_ = new SaveAsDocumentPromptEventArgs();

                    OnSaveAsDocumentPrompt(this, args_);

                    if (args_.IsHandled)
                    {
                        fileName_ = args_.FileName;
                    }
                }
            }

            var args = new DocumentSaveAsEventArgs
            {
                FileName = fileName_
            };

            OnSaveAsDocument?.Invoke(this, args);
        }
コード例 #2
0
        virtual public void SaveDocumentAs()
        {
            string fileName_ = string.Empty;

            if (isDocumentModified && documentFileName != string.Empty)
            {
                if (OnSaveDoucmentAsPrompt != null)
                {
                    DocumentSaveAsPromptEventArgs args = new DocumentSaveAsPromptEventArgs();

                    OnSaveDoucmentAsPrompt(this, args);

                    if (args.IsHandled)
                    {
                        fileName_ = args.FileName;
                    }
                }
            }

            if (OnSaveDocumentAs != null)
            {
                DocumentSaveAsEventArgs args = new DocumentSaveAsEventArgs();
                args.FileName = fileName_;
                OnSaveDocumentAs(this, args);
            }
        }