internal static bool Show(Vector2 position, IProvider provider)
        {
            // If the window is already open, close it instead.
            UnityEngine.Object[] wins = Resources.FindObjectsOfTypeAll(typeof(FilterPopupWindow));
            if (wins.Length > 0)
            {
                try
                {
                    ((EditorWindow)wins[0]).Close();
                    return(false);
                }
                catch (Exception)
                {
                    s_FilterWindow = null;
                }
            }

            // We could not use realtimeSinceStartUp since it is set to 0 when entering/exitting playmode, we assume an increasing time when comparing time.
            long nowMilliSeconds = System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond;
            bool justClosed      = nowMilliSeconds < s_LastClosedTime + 50;

            if (!justClosed)
            {
                Event.current.Use();
                if (s_FilterWindow == null)
                {
                    s_FilterWindow = ScriptableObject.CreateInstance <FilterPopupWindow>();
                }
                s_FilterWindow.Init(position, provider);
                return(true);
            }
            return(false);
        }
 public virtual bool OnGUI(FilterPopupWindow sFilterWindow)
 {
     return(false);
 }
 public virtual bool HandleKeyboard(Event evt, FilterPopupWindow w, Action goToParent)
 {
     return(false);
 }
 void OnDisable()
 {
     s_LastClosedTime = System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond;
     s_FilterWindow   = null;
 }
 void OnEnable()
 {
     s_FilterWindow = this;
     m_Search       = "";
 }