示例#1
0
        protected bool SelectFromList(List <CatalogItem> list, int selectedIndex, int rowHeight, out CatalogItem selectedItem)
        {
            var _selectingItemForm = new WMS_client.Base.Visual.SelectingItem();

            _selectingItemForm.SetRowHeight(rowHeight);
            _selectingItemForm.DataSource    = list;
            _selectingItemForm.SelectedIndex = selectedIndex;

            this.selectingItemForm = _selectingItemForm;
            selectingFromList      = true;
            var selectResult = _selectingItemForm.ShowDialog();

            selectingFromList      = false;
            this.selectingItemForm = null;

            if (selectResult == DialogResult.OK)
            {
                selectedItem = list[_selectingItemForm.SelectedIndex < 0 ? 0 : _selectingItemForm.SelectedIndex];
                return(true);
            }

            selectedItem = null;
            return(false);
        }
示例#2
0
        protected bool SelectFromList(List<CatalogItem> list, int selectedIndex, int rowHeight, out CatalogItem selectedItem)
        {
            var _selectingItemForm = new WMS_client.Base.Visual.SelectingItem();
            _selectingItemForm.SetRowHeight(rowHeight);
            _selectingItemForm.DataSource = list;
            _selectingItemForm.SelectedIndex = selectedIndex;

            this.selectingItemForm = _selectingItemForm;
            selectingFromList = true;
            var selectResult = _selectingItemForm.ShowDialog();
            selectingFromList = false;
            this.selectingItemForm = null;

            if (selectResult == DialogResult.OK)
                {
                selectedItem = list[_selectingItemForm.SelectedIndex < 0 ? 0 : _selectingItemForm.SelectedIndex];
                return true;
                }

            selectedItem = null;
            return false;
        }