diff --git a/Components/Common.vb b/Components/Common.vb index e1233cd..ee21bd0 100755 --- a/Components/Common.vb +++ b/Components/Common.vb @@ -796,6 +796,18 @@ Namespace Ventrian.NewsArticles return retval End Function + Public shared Function ToList(Of T As Class)(objArrayList As ArrayList) As List(Of T) + Dim retval As New List(Of T)() + + For Each objItem As Object In objArrayList + Dim newItem As T = TryCast(objItem, T) + If Not newItem Is Nothing Then + retval.Add(newItem) + End If + Next + + Return retval + End Function #End Region diff --git a/Installs/NewsArticles.00.12.00.zip b/Installs/NewsArticles.00.12.00.zip new file mode 100644 index 0000000..e770257 Binary files /dev/null and b/Installs/NewsArticles.00.12.00.zip differ diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 52ca28f..8d6c280 100755 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/NewsArticles.dnn b/NewsArticles.dnn index 4c2af18..1722e90 100755 --- a/NewsArticles.dnn +++ b/NewsArticles.dnn @@ -1,6 +1,6 @@ - + News Articles - + News Articles Latest Allows you to display a list of the latest articles. @@ -925,7 +925,7 @@ - + News Articles Comments Allows you to display a list of the latest comments. @@ -986,7 +986,7 @@ - + News Articles Archives Allows you to display a list of articles by month. @@ -1047,7 +1047,7 @@ - + News Articles Search Allows you to display a list of articles by month. diff --git a/ucViewOptions.ascx.vb b/ucViewOptions.ascx.vb index bf8dd19..1b9b8ea 100755 --- a/ucViewOptions.ascx.vb +++ b/ucViewOptions.ascx.vb @@ -79,9 +79,9 @@ Namespace Ventrian.NewsArticles roles = RoleController.Instance.GetRoles(PortalId) Else Dim objRole As New RoleController - roles = objRole.GetRolesByGroup(PortalId, Convert.ToInt32(drpSecurityRoleGroups.SelectedValue)) + roles = Common.ToList(Of RoleInfo)(objRole.GetRolesByGroup(PortalId, Convert.ToInt32(drpSecurityRoleGroups.SelectedValue))) End If - + If Not roles Is Nothing Then For Each Role As RoleInfo In roles availableRoles.Add(New ListItem(Role.RoleName, Role.RoleName))