Beispiel #1
0
        private void InitializeUserItems(IEnumerable <ColumnHeaderConfig> items)
        {
            LBox_UserItem.BeginUpdate();
            {
                LBox_UserItem.Items.Clear();

                foreach (var column in items)
                {
                    LBox_UserItem.Items.Add(new ColumnItemObject(column));
                }
            }
            LBox_UserItem.EndUpdate();
        }
Beispiel #2
0
        private void UpdateUserItemView(ColumnItemObject item)
        {
            var index = LBox_UserItem.Items.IndexOf(item);

            if (index >= 0)
            {
                LBox_UserItem.BeginUpdate();

                LBox_UserItem.Items.Remove(item);
                LBox_UserItem.Items.Insert(index, item);

                LBox_UserItem.EndUpdate();
            }
        }
Beispiel #3
0
        private void LBox_UserItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (user_select_item_ != null)
            {
                SaveSelectItemConfig(user_select_item_);
                UpdateUserItemView(user_select_item_);
            }

            user_select_item_ = LBox_UserItem.SelectedItem as ColumnItemObject;

            if (user_select_item_ != null)
            {
                LoadSelectItemConfig(user_select_item_);
            }

            LBox_UserItem.Update();
        }
Beispiel #4
0
        private void LBox_UserItem_MouseMove(object sender, MouseEventArgs e)
        {
            if ((e.Button == MouseButtons.Left) &&
                (user_moving_item_ != null)
                )
            {
                /* 移動位置を取得 */
                var index_new = GetListBoxIndex(LBox_UserItem, e.Location);
                var index_now = LBox_UserItem.Items.IndexOf(user_moving_item_);

                if (index_now != index_new)
                {
                    LBox_UserItem.BeginUpdate();
                    {
                        LBox_UserItem.Items.RemoveAt(index_now);
                        LBox_UserItem.Items.Insert(Math.Min(index_new, LBox_UserItem.Items.Count), user_moving_item_);
                        LBox_UserItem.SelectedItem = user_moving_item_;
                    }
                    LBox_UserItem.EndUpdate();
                }
            }
        }