Ejemplo n.º 1
0
            public HResult Close(NiFrameCloseMode closeMode)
            {
                try
                {
                    VerifyNotDisposed();

                    _owner._suppressClosing = true;

                    try
                    {
                        bool cancel = false;
                        _owner.RaiseClose(closeMode, ref cancel);

                        if (cancel)
                        {
                            return(HResult.False);
                        }

                        _owner.Close();
                    }
                    finally
                    {
                        _owner._suppressClosing = false;
                    }

                    return(HResult.OK);
                }
                catch (Exception ex)
                {
                    return(ErrorUtil.GetHResult(ex));
                }
            }
Ejemplo n.º 2
0
 public void RaiseClose(NiFrameCloseMode closeMode, ref bool cancel)
 {
     if (!_disposed)
     {
         _host.RaiseClose(closeMode, ref cancel);
     }
 }
Ejemplo n.º 3
0
                public void OnClose(NiFrameCloseMode closeMode, ref bool cancel)
                {
                    try
                    {
                        if (_owner._docData == null)
                        {
                            return;
                        }

                        NiSaveMode saveMode;

                        switch (closeMode)
                        {
                        case NiFrameCloseMode.PromptSave: saveMode = NiSaveMode.Save; break;

                        case NiFrameCloseMode.SaveIfDirty: saveMode = NiSaveMode.SilentSave; break;

                        default: return;
                        }

                        string document;
                        bool   saved;
                        ErrorUtil.ThrowOnFailure(_owner._docData.SaveDocData(saveMode, out document, out saved));

                        cancel = !saved;
                    }
                    catch (Exception ex)
                    {
                        Log.Warn("Failed to save document", ex);
                    }
                }
Ejemplo n.º 4
0
        public void RaiseClose(NiFrameCloseMode closeMode, ref bool cancel)
        {
            bool notifyCancel = cancel;

            _connectionPoint.ForAll(p => p.OnClose(closeMode, ref notifyCancel));

            cancel = notifyCancel;
        }
Ejemplo n.º 5
0
        public void RaiseClose(NiFrameCloseMode closeMode, ref bool cancel)
        {
            bool notifyCancel = cancel;

            _connectionPoint.ForAll(p => p.OnClose(closeMode, ref notifyCancel));

            cancel = notifyCancel;
        }
Ejemplo n.º 6
0
            public void OnClose(NiFrameCloseMode closeMode, ref bool cancel)
            {
                try
                {
                    _manager._window = null;

                    Dispose();
                }
                catch (Exception ex)
                {
                    Log.Warn("Failed to handle close of notifications tool window", ex);
                }
            }
Ejemplo n.º 7
0
 public void OnClose(NiFrameCloseMode closeMode, ref bool cancel)
 {
 }
Ejemplo n.º 8
0
 public void OnClose(NiFrameCloseMode closeMode, ref bool cancel)
 {
 }
Ejemplo n.º 9
0
            public void OnClose(NiFrameCloseMode closeMode, ref bool cancel)
            {
                try
                {
                    _manager._window = null;

                    Dispose();
                }
                catch (Exception ex)
                {
                    Log.Warn("Failed to handle close of notifications tool window", ex);
                }
            }
Ejemplo n.º 10
0
 public void RaiseClose(NiFrameCloseMode closeMode, ref bool cancel)
 {
     if (!_disposed)
         _host.RaiseClose(closeMode, ref cancel);
 }
Ejemplo n.º 11
0
            public HResult Close(NiFrameCloseMode closeMode)
            {
                try
                {
                    VerifyNotDisposed();

                    _owner._suppressClosing = true;

                    try
                    {
                        bool cancel = false;
                        _owner.RaiseClose(closeMode, ref cancel);

                        if (cancel)
                            return HResult.False;

                        _owner.Close();
                    }
                    finally
                    {
                        _owner._suppressClosing = false;
                    }

                    return HResult.OK;
                }
                catch (Exception ex)
                {
                    return ErrorUtil.GetHResult(ex);
                }
            }