示例#1
0
        private void comboBoxHomeFileType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxFileType.SelectedIndex == -1)
            {
                SelectedFilesType = Types.All;
            }
            else if (comboBoxFileType.SelectedIndex == 0)
            {
                SelectedFilesType = Types.All;
            }
            else if (comboBoxFileType.SelectedIndex == 1)
            {
                SelectedFilesType = Types.Video;
            }
            else if (comboBoxFileType.SelectedIndex == 2)
            {
                SelectedFilesType = Types.Audio;
            }
            else if (comboBoxFileType.SelectedIndex == 3)
            {
                SelectedFilesType = Types.Books;
            }
            else if (comboBoxFileType.SelectedIndex == 4)
            {
                SelectedFilesType = Types.Subtitle;
            }
            else if (comboBoxFileType.SelectedIndex == 5)
            {
                SelectedFilesType = Types.Torrent;
            }
            else if (comboBoxFileType.SelectedIndex == 6)
            {
                SelectedFilesType = Types.Software;
            }
            else if (comboBoxFileType.SelectedIndex == 7)
            {
                SelectedFilesType = Types.Other;
            }

            var startText = buttonFileType.Text.Split(':');

            buttonFileType.Text     = startText[0] + ": " + comboBoxFileType.GetItemText(comboBoxFileType.SelectedItem);
            containerFileType.Width = ControlExtensions.GetMaxPanelWidth(buttonFileType);
        }
示例#2
0
        private void comboBoxFilesHost_SelectedIndexChanged(object sender, EventArgs e)
        {
            var startText = buttonFilterFiles.Text.Split(':');

            buttonFilterFiles.Text      = startText[0] + ": " + comboBoxFilterFiles.GetItemText(comboBoxFilterFiles.SelectedItem);
            flowLayoutFilterFiles.Width = ControlExtensions.GetMaxPanelWidth(buttonFilterFiles);
            Refresh();

            comboBoxFilterFiles.DropDownWidth = ControlExtensions.GetMaxDropDownWidth(comboBoxFilterFiles);

            if (comboBoxFilterFiles.SelectedIndex == 0)
            {
                SelectedFilesHost = "";
            }
            else
            {
                SelectedFilesHost = comboBoxFilterFiles.SelectedItem.ToString();
            }
        }
示例#3
0
        private void comboBoxFilesSort_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxSortFiles.SelectedIndex == 0)
            {
                SelectedFilesSort = Query.SortBy.Name;
            }
            else if (comboBoxSortFiles.SelectedIndex == 1)
            {
                SelectedFilesSort = Query.SortBy.Size;
            }
            else if (comboBoxSortFiles.SelectedIndex == 2)
            {
                SelectedFilesSort = Query.SortBy.Date;
            }

            var startText = buttonSortFiles.Text.Split(':');

            buttonSortFiles.Text      = startText[0] + ": " + comboBoxSortFiles.GetItemText(comboBoxSortFiles.SelectedItem);
            flowLayoutSortFiles.Width = ControlExtensions.GetMaxPanelWidth(buttonSortFiles);
        }