Ejemplo n.º 1
0
        /// <summary>
        /// Handle when document has been saved
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDocumentSaved(global::System.EventArgs e)
        {
            base.OnDocumentSaved(e);

            // Notify the Running Document Table that the subordinate has been saved
            // If this was a SaveAs, then let the subordinate document do this notification itself.
            // Otherwise VS will never ask the subordinate to save itself.
            DslShell::DocumentSavedEventArgs savedEventArgs = e as DslShell::DocumentSavedEventArgs;

            if (savedEventArgs != null && this.ServiceProvider != null)
            {
                this.NotifySubordinateDocumentSaved(savedEventArgs.OldFileName, savedEventArgs.NewFileName);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handle when document has been saved
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDocumentSaved(global::System.EventArgs e)
        {
            base.OnDocumentSaved(e);

            // Notify the Running Document Table that the subordinate has been saved
            // If this was a SaveAs, then let the subordinate document do this notification itself.
            // Otherwise VS will never ask the subordinate to save itself.
            DslShell::DocumentSavedEventArgs savedEventArgs = e as DslShell::DocumentSavedEventArgs;

            if (savedEventArgs != null && this.ServiceProvider != null)
            {
                if (global::System.StringComparer.OrdinalIgnoreCase.Compare(savedEventArgs.OldFileName, savedEventArgs.NewFileName) == 0)
                {
                    VSShellInterop::IVsRunningDocumentTable rdt = (VSShellInterop.IVsRunningDocumentTable) this.ServiceProvider.GetService(typeof(VSShellInterop::IVsRunningDocumentTable));
                    if (rdt != null && this.diagramDocumentLockHolder != null && this.diagramDocumentLockHolder.SubordinateDocData != null)
                    {
                        global::Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(rdt.NotifyOnAfterSave(this.diagramDocumentLockHolder.SubordinateDocData.Cookie));
                    }
                }
            }
        }