Exemplo n.º 1
0
 public UInt32 AddPreset(RecSettingData Data, string Name)
 {
     uint NextID = Presets.Count == 0 ? 0 : Presets.OrderByDescending(s => s.Key).Last().Key + 1;
     if (Presets.ContainsKey(NextID)) return 0xFFFFFFFF;
     RecPresetItem ItemInfo = new RecPresetItem()
     {
         DisplayName = Name,
         ID = NextID
     };
     Presets.Add(NextID, new KeyValuePair<RecPresetItem, RecSettingData>(ItemInfo, Data));
     return NextID;
 }
Exemplo n.º 2
0
 protected static void CopyData(RecPresetItem src, RecPresetItem dest)
 {
     dest.DisplayName = src.DisplayName;
     dest.ID = src.ID;
     dest.recPresetData = src.recPresetData.Clone();//nullのときはnullが返る。
 }
Exemplo n.º 3
0
        public RecSettingView()
        {
            InitializeComponent();

            try
            {
                if (Settings.Instance.NoStyle == 1)
                {
                    button_add_preset.Style = null;
                    button_chg_preset.Style = null;
                    button_del_preset.Style = null;
                    button_recFolderAdd.Style = null;
                    button_recFolderChg.Style = null;
                    button_recFolderDel.Style = null;
                    button_bat.Style = null;
                    button_recFolderAdd_1seg.Style = null;
                    button_recFolderChg_1seg.Style = null;
                    button_recFolderDel_1seg.Style = null;
                }

                Settings.GetDefRecSetting(0, ref recSetting);

                comboBox_recMode.DataContext = CommonManager.Instance.RecModeDictionary.Values;
                comboBox_tuijyu.DataContext = CommonManager.Instance.YesNoDictionary.Values;
                comboBox_pittari.DataContext = CommonManager.Instance.YesNoDictionary.Values;
                comboBox_priority.DataContext = CommonManager.Instance.PriorityDictionary.Values;

                tunerList.Add(new TunerSelectInfo("自動", 0));
                foreach (TunerReserveInfo info in CommonManager.Instance.DB.TunerReserveList.Values)
                {
                    if (info.tunerID != 0xFFFFFFFF)
                    {
                        tunerList.Add(new TunerSelectInfo(info.tunerName, info.tunerID));
                    }
                }
                comboBox_tuner.ItemsSource = tunerList;
                comboBox_tuner.SelectedIndex = 0;

                RecPresetItem preDef = new RecPresetItem();
                preDef.DisplayName = "デフォルト";
                preDef.ID = 0;
                RecSettingData defSet = new RecSettingData();
                Settings.GetDefRecSetting(0, ref defSet);
                presetList.Add(0, defSet);

                comboBox_preSet.Items.Add(preDef);
                comboBox_preSet.SelectedIndex = 0;
                lastSelectIndex = 0;

                foreach (RecPresetItem info in Settings.Instance.RecPresetList)
                {
                    if (presetList.ContainsKey(info.ID) == false)
                    {
                        RecSettingData setDatat = new RecSettingData();
                        Settings.GetDefRecSetting(info.ID, ref setDatat);

                        presetList.Add(info.ID, setDatat);

                        comboBox_preSet.Items.Add(info);
                    }
                }

                if (CommonManager.Instance.NWMode == true)
                {
                    button_bat.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Exemplo n.º 4
0
        public void SetDefSetting(RecSettingData set)
        {
            RecPresetItem preCust = new RecPresetItem();
            preCust.DisplayName = "登録時";
            preCust.ID = 0xFFFFFFFF;
            int index = comboBox_preSet.Items.Add(preCust);

            setDefSetting = set;
            recSetting = set;
            comboBox_preSet.SelectedIndex = index;

            UpdateView();
        }
Exemplo n.º 5
0
        public void AddPreset(String name)
        {
            RecSettingData newSet = new RecSettingData();
            Settings.GetDefRecSetting(0, ref newSet);

            RecPresetItem newInfo = new RecPresetItem();
            newInfo.DisplayName = name;
            newInfo.ID = 0;

            while (presetList.ContainsKey(newInfo.ID) == true)
            {
                newInfo.ID++;
            }

            presetList.Add(newInfo.ID, newSet);
            int index = comboBox_preSet.Items.Add(newInfo);
            SavePreset();
            comboBox_preSet.SelectedIndex = index;
        }
Exemplo n.º 6
0
 private void button_add_preset_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var setting = new AddPresetWindow();
         PresentationSource topWindow = PresentationSource.FromVisual(this);
         if (topWindow != null)
         {
             setting.Owner = (Window)topWindow.RootVisual;
         }
         if (setting.ShowDialog() == true)
         {
             RecPresetItem preCust = FindPresetItem(0xFFFFFFFF);
             int insertIndex = comboBox_preSet.Items.Count + (preCust == null ? 0 : -1);
             var newInfo = new RecPresetItem(setting.GetName(), 0, GetRecSetting());//IDはSavePresetですぐ割り振られる。
             comboBox_preSet.Items.Insert(insertIndex, newInfo);
             comboBox_preSet.SelectedIndex = insertIndex;
             SavePreset();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
     }
 }