internal SceneEditTransaction(IExternalChanges externalChanges, SceneDocument document, IUndoTransaction undo)
        {
            this.document             = document;
            this.delayExternalChanges = externalChanges != null?externalChanges.DelayNotification() : (IDisposable)null;

            this.undo = undo;
        }
Beispiel #2
0
        public new bool?ShowDialog()
        {
            bool?dialogResult = null;

            using (IDisposable disposable = TemporaryCursor.SetCursor(Cursors.Arrow))
            {
                try
                {
                    try
                    {
                        base.SetValue(Dialog.IsModalProperty, (object)true);
                        IExternalChanges service = null;
                        if (Dialog.ServiceProvider != null)
                        {
                            service = (IExternalChanges)Dialog.ServiceProvider.GetService(typeof(IExternalChanges));
                        }
                        if (service == null)
                        {
                            dialogResult = base.ShowDialog();
                        }
                        else
                        {
                            using (IDisposable disposable1 = service.DelayNotification())
                            {
                                dialogResult = base.ShowDialog();
                            }
                        }
                    }
                    catch (Win32Exception win32Exception1)
                    {
                        Win32Exception win32Exception = win32Exception1;
                        if (win32Exception.ErrorCode != -2147467259 || (win32Exception.NativeErrorCode != 1400 || !(win32Exception.TargetSite.Name == "PostMessage")) && (win32Exception.NativeErrorCode != 87 || !(win32Exception.TargetSite.Name == "SetFocus")))
                        {
                            throw;
                        }
                        else
                        {
                            dialogResult = base.DialogResult;
                        }
                    }
                }
                finally
                {
                    base.SetValue(Dialog.IsModalProperty, (object)false);
                    if (Application.Current != null && Application.Current.MainWindow != null)
                    {
                        Application.Current.MainWindow.Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 3), new DispatcherOperationCallback((object arg) => null), null);
                    }
                }
            }
            return(dialogResult);
        }