Imports BVSoftware.BVC.Core Public Class configuration_payment_methods Inherits BaseAdminPage Protected WithEvents chkSendMail As System.Web.UI.WebControls.CheckBox Protected WithEvents inSendMailTo As System.Web.UI.WebControls.TextBox Protected WithEvents btnCancel As System.Web.UI.WebControls.ImageButton Protected WithEvents MetaDescriptionControl As BVSoftware.WebControls.MetaTag Protected WithEvents MetaKeywordsControl As BVSoftware.WebControls.MetaTag Protected WithEvents msg As BVSoftware.WebControls.WebPageMessage Protected WithEvents lstProcessorPlugins As System.Web.UI.WebControls.RadioButtonList #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load BVC2004Store.CheckThisPage(Security.RolePermission.LoginToAdmin) BVC2004Store.CheckThisPage(Security.RolePermission.AccessSettingsArea) If Not Page.IsPostBack Then MetaKeywordsControl.Content = WebAppSettings.MetaKeywords MetaDescriptionControl.Content = WebAppSettings.MetaDescription End If If Not Page.IsPostBack Then Try ' Load Values from Config PopulateProcessorPlugins() Catch Ex As Exception msg.ShowException(Ex) End Try End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnCancel.Click Response.Redirect("configuration_Payment.aspx") End Sub Sub PopulateProcessorPlugins() Me.lstProcessorPlugins.Items.Clear() Dim searchPath As String = Request.PhysicalApplicationPath If searchPath.EndsWith("\") = False Then searchPath += "\" End If searchPath += "plugins\payment\CCProcessors\" Dim loader As PluginLoader Dim plugins As AvailablePlugIn() plugins = loader.FindPlugins(searchPath, "BVSoftware.BVC.Interfaces.IBVSoftwarePlugin") If Not plugins Is Nothing Then If plugins.Length() > 0 Then Dim i As Integer For i = 0 To plugins.Length() - 1 Try Dim component As BVSoftware.BVC.Interfaces.BVSoftwarePlugin = CType(loader.CreateInstance(plugins(i)), BVSoftware.BVC.Interfaces.BVSoftwarePlugin) If Not component Is Nothing Then Me.lstProcessorPlugins.Items.Add(New ListItem(component.DisplayName & " " & BuildEditLink(component.ComponentID), component.ComponentID)) End If component = Nothing Catch ex As Exception EventLog.LogEvent(ex) End Try Next End If End If Me.lstProcessorPlugins.ClearSelection() Dim found As Boolean = False Dim j As Integer For j = 0 To Me.lstProcessorPlugins.Items.Count() - 1 If found = False Then If Me.lstProcessorPlugins.Items(j).Value = WebAppSettings.CCProcessorID Then Me.lstProcessorPlugins.Items(j).Selected = True found = True End If End If Next ' Set the first item as selected if nothing else is If Me.lstProcessorPlugins.SelectedItem Is Nothing Then If Me.lstProcessorPlugins.Items.Count > 0 Then Me.lstProcessorPlugins.Items(0).Selected = True End If End If plugins = Nothing loader = Nothing End Sub Private Function BuildEditLink(ByVal id As String) As String Dim sLink As String = "" sLink = "Edit" Return sLink End Function Sub lstProcessorPlugins_Change(ByVal sender As Object, ByVal e As EventArgs) Handles lstProcessorPlugins.SelectedIndexChanged WebAppSettings.CCProcessorID = lstProcessorPlugins.SelectedValue End Sub End Class