Exemplo n.º 1
0
        void WrappedInspectorWindow_Close(object sender, EventArgs e)
        {
            OutlookInspector window = (OutlookInspector)sender;

            window.Close -= new EventHandler(WrappedInspectorWindow_Close);
            m_InspectorWindows.Remove(window);
        }
Exemplo n.º 2
0
        /// <summary>
        /// The NewInspector event fires whenever a new Inspector is displayed.
        /// </summary>
        /// <param name="Explorer"></param>
        void m_Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
        {
            m_Ribbon.Invalidate();

            try
            {
                // Check to see if this is a new window
                // we don't already track
                OutlookInspector existingWindow =
                    FindOutlookInspector(Inspector);
                // If the m_InspectorWindows collection does not
                // have a window for this Inspector,
                // we should add it to m_InspectorWindows
                if (existingWindow == null)
                {
                    OutlookInspector window = new OutlookInspector(Inspector);
                    window.Close             += new EventHandler(WrappedInspectorWindow_Close);
                    window.InvalidateControl += new EventHandler <
                        OutlookInspector.InvalidateEventArgs>(
                        WrappedInspectorWindow_InvalidateControl);
                    m_InspectorWindows.Add(window);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }