private void AddPopupToQueue(FMPopup popup, FMPopupManager.FMPopupPriority priority) { FMPopupManager.FMPPopupQueueItem item = new FMPopupManager.FMPPopupQueueItem(popup, priority); if (this.queuedList.Count == 0) { this.queuedList.Add(item); } else { int num = this.queuedList.Count; for (int i = this.queuedList.Count - 1; i >= 0; i--) { if (item.priority < this.queuedList[i].priority) { num = i; } else if (this.queuedList[i].priority == item.priority) { break; } } if (num >= this.queuedList.Count) { this.queuedList.Add(item); } else { this.queuedList.Insert(num, item); } } }
protected void ClearQueueByPriority(FMPopupManager.FMPopupPriority priority) { if (this.queuedList.Count > 0) { for (int i = this.queuedList.Count - 1; i >= 0; i--) { if (this.queuedList[i].priority == priority) { this.queuedList.RemoveAt(i); } } } }
protected void Open(FMPopup popup, FMPopupManager.FMPopupPriority priority = FMPopupManager.FMPopupPriority.Normal) { if (this.ActivePopup == null) { this.ActivePopup = popup; this.ActivePopup.Open(); } else { this.AddPopupToQueue(popup, priority); if (priority == FMPopupManager.FMPopupPriority.ForceOpen) { this.CloseActivePopup(true); } } }
public FMPPopupQueueItem(FMPopup popup, FMPopupManager.FMPopupPriority priority) { this.popup = popup; this.priority = priority; }