Ejemplo n.º 1
0
        private SettingVideoChat GetSetting()
        {
            SettingVideoChat settingForm = new SettingVideoChat();

            settingForm.Name    = lblUserName.Text;
            settingForm.Quality = (Qualityes)cb_Quality.SelectedIndex;
            return(settingForm);
        }
Ejemplo n.º 2
0
        private bool CheckFormSetting(SettingVideoChat settingForm)
        {
            bool result = true;

            if (!CorrectName(settingForm.Name))
            {
                result = false;
            }
            return(result);
        }
Ejemplo n.º 3
0
        private void SaveSetting()
        {
            SettingVideoChat settingForm = GetSetting();
            XmlSerializer    formatter   = new XmlSerializer(settingForm.GetType());
            var ns = new XmlSerializerNamespaces();

            ns.Add("", "");
            using (FileStream fs = new FileStream(Defines.pathSettingFile, FileMode.Create))
            {
                formatter.Serialize(fs, settingForm, ns);
            }
        }
Ejemplo n.º 4
0
 private void LoadSetting()
 {
     try
     {
         SettingVideoChat settingForm = new SettingVideoChat();
         XmlSerializer    formatter   = new XmlSerializer(settingForm.GetType());
         using (FileStream fs = new FileStream(Defines.pathSettingFile, FileMode.Open))
         {
             settingForm = (SettingVideoChat)formatter.Deserialize(fs);
         }
         if (CheckFormSetting(settingForm))
         {
             SetSetting(settingForm);
         }
         else
         {
             SetSetting(Defines.defaultSetting);
         }
     }
     catch (Exception)
     {
         SetSetting(Defines.defaultSetting);
     }
 }
Ejemplo n.º 5
0
 private void SetSetting(SettingVideoChat settingForm)
 {
     lblUserName.Text = settingForm.Name;
     cb_Quality.Text  = (settingForm.Quality).ToString();
     SetParamsQuality();
 }