Esempio n. 1
0
        // Runs on our automation thread
        void _windowWatcher_ExcelToolTipWindowChanged(object sender, WindowWatcher.WindowChangedEventArgs e)
        {
            switch (e.Type)
            {
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Show:
                if (!_toolTips.Contains(e.WindowHandle))
                {
                    _toolTips.Add(e.WindowHandle);
                    ToolTipChanged?.Invoke(this, new ToolTipChangeEventArgs(ToolTipChangeType.Show, e.WindowHandle));
                }
                break;

            case WindowWatcher.WindowChangedEventArgs.ChangeType.Hide:
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Destroy:
                if (_toolTips.Remove(e.WindowHandle))
                {
                    ToolTipChanged?.Invoke(this, new ToolTipChangeEventArgs(ToolTipChangeType.Hide, e.WindowHandle));
                }
                break;

            case WindowWatcher.WindowChangedEventArgs.ChangeType.Create:
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Focus:
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Unfocus:
            default:
                // Ignoring these....
                break;
            }
        }
Esempio n. 2
0
        // Runs on our automation thread
        void _windowWatcher_ExcelToolTipWindowChanged(object sender, WindowWatcher.WindowChangedEventArgs e)
        {
            switch (e.Type)
            {
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Show:
                if (!_toolTips.Contains(e.WindowHandle))
                {
                    _toolTips.Add(e.WindowHandle);
                    ToolTipChanged?.Invoke(this, new ToolTipChangeEventArgs(ToolTipChangeType.Show, e.WindowHandle));
                }
                break;

            case WindowWatcher.WindowChangedEventArgs.ChangeType.Hide:
                if (_toolTips.Remove(e.WindowHandle))
                {
                    ToolTipChanged?.Invoke(this, new ToolTipChangeEventArgs(ToolTipChangeType.Hide, e.WindowHandle));
                }
                break;

            case WindowWatcher.WindowChangedEventArgs.ChangeType.Destroy:
                // Not expecting this anymore - Destroy is no longer routed from the WinEvents.
                Debug.Fail("Unexpected ChangeType");
                break;

            case WindowWatcher.WindowChangedEventArgs.ChangeType.Create:
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Focus:
            case WindowWatcher.WindowChangedEventArgs.ChangeType.Unfocus:
            default:
                // Ignoring these....
                break;
            }
        }
Esempio n. 3
0
 private void tabItem_InternalToolTipChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     ToolTipChanged?.Invoke(this, e);
 }