예제 #1
0
        public void Close(OdgePopUp popup)
        {
            int c = popupQ.Count;

            for (int p = 0; p < c; p++)
            {
                OdgePopUp pop = popupQ.Dequeue();
                if (!(pop == popup))
                {
                    popupQ.Enqueue(pop);
                }
            }
        }
예제 #2
0
        public void UpdatePopup()
        {
            if (popupQ.Count > 0)
            {
                // Check for style changes.
                foreach (OdgePopUp odge in popupQ)
                {
                    if (odge.Style.IsChanged)
                    {
                        odge.OnStyleChanged();
                        odge.Style.AcceptChanges();
                    }
                }

                // Reset Style.IsChanged flag separately, to avoid skips.
                foreach (OdgePopUp odge in popupQ)
                {
                    if (odge.Style.IsChanged)
                    {
                        odge.Style.AcceptChanges();
                    }
                }



                if (RunAllPopUps)
                {
                    int c = popupQ.Count;
                    for (int p = 0; p < c; p++)
                    {
                        OdgePopUp pop = popupQ.Dequeue();
                        if (pop.Timeout > 0)
                        {
                            pop.Update();
                            popupQ.Enqueue(pop);
                        }
                    }
                }
                else
                {
                    if (popupQ.Peek().Timeout > 0)
                    {
                        popupQ.Peek().Update();
                    }
                    else
                    {
                        popupQ.Dequeue();
                    }
                }
            }
        }
예제 #3
0
        public void Open(OdgePopUp popup)
        {
            if (popup._manager != null && popup._manager != this)
            {
                throw new OdgeComponentUsedException("OdgePopUp has already been added to another OdgeUI manager.");
            }
            popup._manager = this;

            if (popup.Style == null)
            {
                popup.Style = GlobalStyle;
            }

            popupQ.Enqueue(popup);
            popup.OnOpened();
        }