示例#1
0
        /// <summary>
        /// Get plugins and fill comboBoxAuthenticationProvider
        /// </summary>
        private void GetPlugins()
        {
            // retrieve plugins  list
            try
            {
                plugins = ServiceUIPlugin.GetPlugins(Path.GetDirectoryName(Application.ExecutablePath) + DLL_FOLDER_NAME, INTERFACE_PLUGIN_NAME);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (plugins == null)
            {
                MessageBox.Show("No plugin found !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            // Fill comboBoxAuthenticationProvider ignore UcBase
            foreach (var plugin in plugins)
            {
                if (plugin.ClassName != USER_CONTROL_CLASS_BASE_NAME)
                {
                    ComboBoxAuthenticationProviderItem comboBoxItem = new ComboBoxAuthenticationProviderItem();
                    // Use item 3 as display value: example RFID for Me.AppPass.UI.RFID.UcRFID
                    comboBoxItem.Text = plugin.ClassName.Split('.')[3];
                    // Value is uc type: example Me.AppPass.UI.RFID.UcRFID
                    comboBoxItem.Value = plugin.ClassName;
                    this.comboBoxAuthenticationProvider.Items.Add(comboBoxItem);
                }
            }
        }
示例#2
0
        /// <summary>
        /// Store in this.currentSelectionPluginValue the item selected value
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBoxAuthenticationProvider_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox comboBoxAuthenticationProvider         = (ComboBox)sender;
            ComboBoxAuthenticationProviderItem itemSelected = (ComboBoxAuthenticationProviderItem)comboBoxAuthenticationProvider.SelectedItem;

            this.currentSelectionPluginValue = itemSelected.Value.ToString();
        }