Ejemplo n.º 1
0
        public EpgSearchKeyInfo GetSearchKey()
        {
            var key = new EpgSearchKeyInfo();

            try
            {
                key.andKey          = comboBox_andKey.Text;
                key.notKey          = comboBox_notKey.Text;
                key.regExpFlag      = checkBox_regExp.IsChecked == true ? 1 : 0;
                key.aimaiFlag       = (byte)(checkBox_aimai.IsChecked == true ? 1 : 0);
                key.titleOnlyFlag   = checkBox_titleOnly.IsChecked == true ? 1 : 0;
                key.caseFlag        = (byte)(checkBox_case.IsChecked == true ? 1 : 0);
                key.keyDisabledFlag = (byte)(checkBox_keyDisabled.IsChecked == true ? 1 : 0);
                key.contentList     = listBox_content.Items.OfType <ContentKindInfo>().Select(info => info.Data).DeepClone();
                key.notContetFlag   = (byte)(checkBox_notContent.IsChecked == true ? 1 : 0);
                key.serviceList     = serviceList.Where(info => info.IsSelected == true).Select(info => (Int64)info.Key).ToList();
                key.dateList        = listBox_date.Items.OfType <DateItem>().Select(info => info.DateInfo).ToList();
                key.notDateFlag     = (byte)(checkBox_notDate.IsChecked == true ? 1 : 0);
                key.freeCAFlag      = (byte)Math.Min(Math.Max(comboBox_free.SelectedIndex, 0), 2);
                key.chkRecEnd       = (byte)(checkBox_chkRecEnd.IsChecked == true ? 1 : 0);
                key.chkRecDay       = (ushort)MenuUtil.MyToNumerical(textBox_chkRecDay, Convert.ToUInt32, 9999u, 0u, 0u);
                key.chkRecNoService = (byte)(radioButton_chkRecNoService2.IsChecked == true ? 1 : 0);
                key.chkDurationMin  = (ushort)MenuUtil.MyToNumerical(textBox_chkDurationMin, Convert.ToUInt32, 9999u, 0u, 0u);
                key.chkDurationMax  = (ushort)MenuUtil.MyToNumerical(textBox_chkDurationMax, Convert.ToUInt32, 9999u, 0u, 0u);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            return(key);
        }
Ejemplo n.º 2
0
        private NWPresetItem GetSetting()
        {
            var preset = new NWPresetItem();

            preset.NWServerIP   = textBox_srvIP.Text;
            preset.NWServerPort = MenuUtil.MyToNumerical(textBox_srvPort, Convert.ToUInt32, Settings.Instance.NWServerPort);
            preset.NWWaitPort   = checkBox_clientPort.IsChecked == false ? 0 : MenuUtil.MyToNumerical(textBox_clientPort, Convert.ToUInt32, Settings.Instance.NWWaitPort);
            preset.NWMacAdd     = textBox_mac.Text;
            return(preset);
        }
Ejemplo n.º 3
0
        private NWPresetItem GetSetting()
        {
            var preset = new NWPresetItem();

            preset.Name         = textBox_Name.Text.Trim();
            preset.NWServerIP   = textBox_srvIP.Text.Trim();
            preset.NWServerPort = MenuUtil.MyToNumerical(textBox_srvPort, Convert.ToUInt32, Settings.Instance.NWServerPort);
            preset.NWWaitPort   = checkBox_clientPort.IsChecked == false ? 0 : MenuUtil.MyToNumerical(textBox_clientPort, Convert.ToUInt32, Settings.Instance.NWWaitPort);
            preset.NWMacAdd     = textBox_mac.Text.Trim();
            preset.NWPassword   = new SerializableSecureString(textBox_Password.SecurePassword);
            if (preset.Name.Length == 0)
            {
                preset.Name = preset.NWServerIP;
            }
            return(preset);
        }
Ejemplo n.º 4
0
        public void GetSearchKey(ref EpgSearchKeyInfo key)
        {
            try
            {
                key.regExpFlag      = (byte)(checkBox_regExp.IsChecked == true ? 1 : 0);
                key.aimaiFlag       = (byte)(checkBox_aimai.IsChecked == true ? 1 : 0);
                key.titleOnlyFlag   = (byte)(checkBox_titleOnly.IsChecked == true ? 1 : 0);
                key.caseFlag        = (byte)(checkBox_case.IsChecked == true ? 1 : 0);
                key.keyDisabledFlag = (byte)(checkBox_keyDisabled.IsChecked == true ? 1 : 0);

                key.contentList.Clear();
                foreach (ContentKindInfo info in listBox_content.Items)
                {
                    EpgContentData item = new EpgContentData();
                    item.content_nibble_level_1 = info.Nibble1;
                    item.content_nibble_level_2 = info.Nibble2;
                    key.contentList.Add(item);
                }
                key.notContetFlag = (byte)(checkBox_notContent.IsChecked == true ? 1 : 0);

                key.serviceList.Clear();
                foreach (ServiceItem info in listView_service.Items)
                {
                    if (info.IsSelected == true)
                    {
                        key.serviceList.Add((Int64)info.ID);
                    }
                }

                key.dateList.Clear();
                foreach (DateItem info in listBox_date.Items)
                {
                    key.dateList.Add(info.DateInfo);
                }
                key.notDateFlag = (byte)(checkBox_notDate.IsChecked == true ? 1 : 0);

                if (radioButton_free_2.IsChecked == true)
                {
                    //無料
                    key.freeCAFlag = 1;
                }
                else if (radioButton_free_3.IsChecked == true)
                {
                    //有料
                    key.freeCAFlag = 2;
                }
                else
                {
                    key.freeCAFlag = 0;
                }

                key.chkRecEnd       = (byte)(checkBox_chkRecEnd.IsChecked == true ? 1 : 0);
                key.chkRecDay       = MenuUtil.MyToNumerical(textBox_chkRecDay, Convert.ToUInt16, ushort.MinValue);
                key.chkRecNoService = (byte)(radioButton_chkRecNoService2.IsChecked == true ? 1 : 0);
                key.chkDurationMin  = MenuUtil.MyToNumerical(textBox_chkDurationMin, Convert.ToUInt16, ushort.MinValue);
                key.chkDurationMax  = MenuUtil.MyToNumerical(textBox_chkDurationMax, Convert.ToUInt16, ushort.MinValue);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }