Beispiel #1
0
 /// <summary>
 /// Accept changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OKBtn_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (IGXSettingsPage it in MediaPropertiesForm)
         {
             it.Apply();
         }
         //Handle external medias.
         Properties.Settings.Default.ExternalMedias = "";
         bool first = true;
         foreach (ListViewItem it in MediaList.Items)
         {
             if (first)
             {
                 first = false;
             }
             else
             {
                 Properties.Settings.Default.ExternalMedias = ";";
             }
             Properties.Settings.Default.ExternalMedias += it.SubItems[2].Text;
         }
         if (checkUpdates != null)
         {
             checkUpdates.Cancel();
         }
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
         this.DialogResult = DialogResult.None;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Accept changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OKBtn_Click(object sender, EventArgs e)
 {
     try
     {
         _eventsTranslator.SystemTitle       = GXCommon.HexToBytes(GetAsHex(SystemTitleTB.Text, SystemTitleAsciiCb.Checked));
         _eventsTranslator.BlockCipherKey    = GXCommon.HexToBytes(GetAsHex(BlockCipherKeyTB.Text, BlockCipherKeyAsciiCb.Checked));
         _eventsTranslator.AuthenticationKey = GXCommon.HexToBytes(GetAsHex(AuthenticationKeyTB.Text, AuthenticationKeyAsciiCb.Checked));
         (notifications as IGXPropertyPage).Apply();
         foreach (IGXSettingsPage it in MediaPropertiesForm)
         {
             it.Apply();
         }
         //Handle external medias.
         Properties.Settings.Default.ExternalMedias = "";
         bool first = true;
         foreach (ListViewItem it in MediaList.Items)
         {
             if (first)
             {
                 first = false;
             }
             else
             {
                 Properties.Settings.Default.ExternalMedias = ";";
             }
             Properties.Settings.Default.ExternalMedias += it.SubItems[2].Text;
         }
         if (checkUpdates != null)
         {
             checkUpdates.Cancel();
         }
         Properties.Settings.Default.GeneratorAddress = CertificationServerTb.Text;
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
         this.DialogResult = DialogResult.None;
     }
 }