예제 #1
0
 private void linkLabelLanguageAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     mpListView2.BeginUpdate();
     try
     {
         for (int i = 0; i < mpListView2.Items.Count; ++i)
         {
             mpListView2.Items[i].Checked = true;
         }
         TvLibrary.Epg.Languages languages = new TvLibrary.Epg.Languages();
         List <String>           codes     = languages.GetLanguageCodes();
         TvBusinessLayer         layer     = new TvBusinessLayer();
         Setting setting = layer.GetSetting("epgLanguages");
         setting.Value = "";
         foreach (string code in codes)
         {
             setting.Value += code;
             setting.Value += ",";
         }
         //Log.WriteFile("tvsetup:epggrabber:all: epglang={0}", setting.Value);
         setting.Persist();
     }
     finally
     {
         mpListView2.EndUpdate();
     }
 }
예제 #2
0
    private void LoadLanguages()
    {
      _loaded = true;
      mpListView2.BeginUpdate();
      try
      {
        mpListView2.Items.Clear();
        TvLibrary.Epg.Languages languages = new TvLibrary.Epg.Languages();
        List<String> codes = languages.GetLanguageCodes();
        List<String> list = languages.GetLanguages();

        TvBusinessLayer layer = new TvBusinessLayer();
        Setting setting = layer.GetSetting(languagesSettingsKey);

        for (int j = 0; j < list.Count; j++)
        {
          ListViewItem item = new ListViewItem(new string[] { list[j], codes[j] });
          mpListView2.Items.Add(item);
          item.Tag = codes[j];
          item.Checked = setting.Value.IndexOf((string)item.Tag) >= 0;
        }
        mpListView2.Sort();

      }
      finally
      {
        mpListView2.EndUpdate();
      }
    }
예제 #3
0
        private void LoadLanguages()
        {
            _loaded = true;
            mpListView2.BeginUpdate();
            try
            {
                mpListView2.Items.Clear();
                TvLibrary.Epg.Languages languages = new TvLibrary.Epg.Languages();
                List <String>           codes     = languages.GetLanguageCodes();
                List <String>           list      = languages.GetLanguages();

                TvBusinessLayer layer   = new TvBusinessLayer();
                Setting         setting = layer.GetSetting("epgLanguages");

                string values = "";
                for (int j = 0; j < list.Count; j++)
                {
                    ListViewItem item = new ListViewItem(new string[] { list[j], codes[j] });
                    mpListView2.Items.Add(item);
                    item.Tag = codes[j];
                    if (setting.Value == "")
                    {
                        values += item.Tag;
                        values += ",";
                    }
                    else
                    {
                        if (setting.Value.IndexOf((string)item.Tag) >= 0)
                        {
                            item.Checked = true;
                        }
                    }
                }
                mpListView2.Sort();

                if (setting.Value == "")
                {
                    setting.Value = values;
                    setting.Persist();
                    //DatabaseManager.Instance.SaveChanges();
                }
            }
            finally
            {
                mpListView2.EndUpdate();
            }
        }
    private void LoadLanguages()
    {
      _loaded = true;
      mpListView2.BeginUpdate();
      try
      {
        mpListView2.Items.Clear();
        TvLibrary.Epg.Languages languages = new TvLibrary.Epg.Languages();
        List<String> codes = languages.GetLanguageCodes();
        List<String> list = languages.GetLanguages();

        TvBusinessLayer layer = new TvBusinessLayer();
        Setting setting = layer.GetSetting("radioLanguages");

        string values = "";
        for (int j = 0; j < list.Count; j++)
        {
          ListViewItem item = new ListViewItem(new string[] { list[j], codes[j] });
          mpListView2.Items.Add(item);
          item.Tag = codes[j];
          if (setting.Value == "")
          {
            values += item.Tag;
            values += ",";
          }
          else
          {
            if (setting.Value.IndexOf((string)item.Tag) >= 0)
            {
              item.Checked = true;
            }
          }
        }
        mpListView2.Sort();

        if (setting.Value == "")
        {
          setting.Value = values;
          setting.Persist();
          //DatabaseManager.Instance.SaveChanges();
        }
      }
      finally
      {
        mpListView2.EndUpdate();
      }
    }
 private void linkLabelLanguageAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
   mpListView2.BeginUpdate();
   try
   {
     for (int i = 0; i < mpListView2.Items.Count; ++i)
     {
       mpListView2.Items[i].Checked = true;
     }
     TvLibrary.Epg.Languages languages = new TvLibrary.Epg.Languages();
     List<String> codes = languages.GetLanguageCodes();
     TvBusinessLayer layer = new TvBusinessLayer();
     Setting setting = layer.GetSetting("radioLanguages");
     setting.Value = "";
     foreach (string code in codes)
     {
       setting.Value += code;
       setting.Value += ",";
     }
     //Log.WriteFile("tvsetup:epggrabber:all: epglang={0}", setting.Value);
     setting.Persist();
   }
   finally
   {
     mpListView2.EndUpdate();
   }
 }