Example #1
0
        private NavigationBarItem GetCurrentTypeItem()
        {
            _dropdownBar.GetCurrentSelection(1, out var currentTypeIndex);

            return(currentTypeIndex >= 0
                ? _currentTypeItems[currentTypeIndex]
                : null);
        }
Example #2
0
        private void ActivateEntries(int position)
        {
            if (_entries == null)
            {
                return;
            }

            int currentModuleIndex;

            _dropDownBar.GetCurrentSelection(ModuleComboBoxId, out currentModuleIndex);

            ModuleEntry newModule = _entries.LocateModule(position);

            Debug.Assert(newModule != null);

            MethodEntry newMethod      = newModule.LocateMethod(position);
            int         newMethodIndex = newMethod != null ? newMethod.Index : -1;

            if (newModule.Index != currentModuleIndex)
            {
                _dropDownBar.SetCurrentSelection(ModuleComboBoxId, newModule.Index);
                _dropDownBar.RefreshCombo(MethodComboBoxId, newMethodIndex);
            }
            else
            {
                int currentMethodIndex;
                _dropDownBar.GetCurrentSelection(MethodComboBoxId, out currentMethodIndex);
                if (newMethodIndex != currentMethodIndex)
                {
                    _dropDownBar.SetCurrentSelection(MethodComboBoxId, newMethodIndex);
                }
            }
        }
        int GetActiveSelection(int comboBoxId)
        {
            if (_activeSelections.TryGetValue(comboBoxId, out var selection))
            {
                return(selection);
            }

            if (_dropdownBar.GetCurrentSelection(comboBoxId, out var sel) == 0)
            {
                return(sel);
            }

            return(-1);
        }