Exemplo n.º 1
0
        void tpwndo_WindowClosed(object sender, OoEventArgs e)
        {
            if (drawWnds.ContainsKey(e.Source as XAccessible))
            {
                //System.Diagnostics.Debug.WriteLine("\t\tknown drawdoc closed");
                OoAccessibleDocWnd doc;
                drawWnds.TryRemove(e.Source as XAccessible, out doc);
                OoAccessibleDocWnd doc2;
                if (doc.DocumentWindow != null && drawDocWnds.ContainsKey(doc.DocumentWindow))
                {
                    drawDocWnds.TryRemove(doc.DocumentWindow, out doc2);
                }
                if (doc.Document != null && drawDocs.ContainsKey(doc.Document))
                {
                    drawDocs.TryRemove(doc.Document, out doc2);
                }

                // release the document
                doc.Dispose();
                fireDrawWindowClosedEvent(doc);
            }
            tpwndo = OoTopWindowObserver.Instance;
        }
        void tpwndo_WindowClosed(object sender, OoEventArgs e)
        {
            if (drawWnds.ContainsKey(e.Source as XAccessible))
            {
                //System.Diagnostics.Debug.WriteLine("\t\tknown drawdoc closed");
                OoAccessibleDocWnd doc;
                drawWnds.TryRemove(e.Source as XAccessible, out doc);
                OoAccessibleDocWnd doc2;
                if (doc.DocumentWindow != null && drawDocWnds.ContainsKey(doc.DocumentWindow))
                {
                    drawDocWnds.TryRemove(doc.DocumentWindow, out doc2);
                }
                if (doc.Document != null && drawDocs.ContainsKey(doc.Document))
                {
                    drawDocs.TryRemove(doc.Document, out doc2);
                }

                // release the document
                doc.Dispose();
                fireDrawWindowClosedEvent(doc);
            }
            tpwndo = OoTopWindowObserver.Instance;
        }