Пример #1
0
        private void SetupQuickMainWindowAndHandler(object obj, QuickContext quickContext, IntPtr windowPtr, bool isGlobal, Process currentProcess)
        {
            if (m_handlerMap == null)
                m_handlerMap = new Dictionary<QuickModel, QuickMainWindowHandler>();
            if (m_windowMap == null)
                m_windowMap = new Dictionary<QuickMainWindowHandler, QuickMainWindow>();

            QuickMainWindowHandler handler = null;
            if (m_handlerMap.ContainsKey(m_currentModel))
            {
                handler = m_handlerMap[m_currentModel];
            }
            else
            {
                handler = new QuickMainWindowHandler(obj, m_currentModel, quickContext, windowPtr, isGlobal, currentProcess);
                m_handlerMap.Add(m_currentModel, handler);
            }

            if (m_windowMap.ContainsKey(handler))
            {
                m_quickMainWindow = m_windowMap[handler];
            }
            else
            {
                m_quickMainWindow = new QuickMainWindow(handler);
                ElementHost.EnableModelessKeyboardInterop(m_quickMainWindow);
                m_windowMap.Add(handler, m_quickMainWindow);
            }

            System.Windows.Media.Color bgColor = System.Windows.Media.Color.FromRgb((byte)m_currentModel.BorderColorR, (byte)m_currentModel.BorderColorG, (byte)m_currentModel.BorderColorB);
            m_quickMainWindow.SetBackgroundColor(bgColor);
        }
Пример #2
0
 private void Trigger(bool forceGetGlobalObject)
 {
     QuickContext quickContext = default(QuickContext);
     bool isGlobal;
     Process currentProcess;
     IntPtr windowPtr;
     object obj = GetActiveObject(forceGetGlobalObject, out isGlobal, out windowPtr, out currentProcess);
     SetupQuickMainWindowAndHandler(obj, quickContext, windowPtr, isGlobal, currentProcess);
     TriggerQuickMainWindow(isGlobal);
 }