Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CB_ContentType_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         IContentTypeState newContentTypeState = (IContentTypeState)((ComboboxItem)this.cb_ContentType.SelectedItem).Value;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Exception: " + ex.Message);
     }
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TB_Host_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                e.SuppressKeyPress = true;

                IContentTypeState contentTypeObj = (IContentTypeState)(this.cb_ContentType.SelectedItem as ComboboxItem).Value;
                string            contentType    = contentTypeObj.UsedContentType;
                SslStripRecord    tmpRecord      = new SslStripRecord(this.tb_HostName.Text.Trim(), contentType);

                try
                {
                    this.AddRecord(tmpRecord);
                }
                catch (Exception ex)
                {
                    this.pluginProperties.HostApplication.LogMessage($"{this.Config.PluginName}: {ex.Message}");
                    MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }