protected bool CheckForElementUpdate() { bool result = false; if (_baseWindow != null) { bool update = false; foreach (var baseElement in _baseWindow.controlList) { if (!_controlList.Contains(baseElement)) { _controlList.Add(baseElement); update = true; } } for (int i = 0; i < _controlList.Count; i++) { var baseElement = _controlList[i]; if (!_baseWindow.controlList.Contains(baseElement)) { _controlList.Remove(baseElement); update = true; } } if (update) { GenerateElements(); result = true; } } return(result); }
/// <summary> /// Performs a base init of the window. This includes the following tasks /// - Setting the reference to the window in MP /// - Setting the reference to the control list of the MP window /// </summary> protected override void BaseInit() { _dialogWindow = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU) as GUIDialogMenu; _baseWindow = _dialogWindow; if (_dialogWindow != null) { _controlList = new GUIControlCollection(); foreach (var baseElement in _dialogWindow.controlList) { _controlList.Add(baseElement); } } }