Skip to content

Commit

Permalink
Solved "easy" obsolete in DNN7.x warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
skamphuis committed Sep 4, 2018
1 parent 0de32b4 commit 684a2d7
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Components/ArticleController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Namespace Ventrian.NewsArticles

Dim objArticles As New List(Of ArticleInfo)
While dr.Read
objArticles.Add(CType(CBO.FillObject(dr, GetType(ArticleInfo), False), ArticleInfo))
objArticles.Add(CBO.FillObject(Of ArticleInfo)(dr, False))
End While

Dim nextResult As Boolean = dr.NextResult()
Expand Down Expand Up @@ -124,7 +124,7 @@ Namespace Ventrian.NewsArticles
Dim objArticle As ArticleInfo = CType(DataCache.GetCache(cacheKey), ArticleInfo)

If (objArticle Is Nothing) Then
objArticle = CType(CBO.FillObject(DataProvider.Instance().GetArticle(articleID), GetType(ArticleInfo)), ArticleInfo)
objArticle = CBO.FillObject(Of ArticleInfo)(DataProvider.Instance().GetArticle(articleID))
If (objArticle Is Nothing) Then
Return Nothing
End If
Expand Down
2 changes: 1 addition & 1 deletion Components/CommentController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Namespace Ventrian.NewsArticles

Public Function GetComment(ByVal commentID As Integer) As CommentInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetComment(commentID), GetType(CommentInfo)), CommentInfo)
Return CBO.FillObject(Of CommentInfo)(DataProvider.Instance().GetComment(commentID))

End Function

Expand Down
2 changes: 1 addition & 1 deletion Components/Controllers/PageController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Namespace Ventrian.NewsArticles

Public Function GetPage(ByVal pageId As Integer) As PageInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetPage(pageId), GetType(PageInfo)), PageInfo)
Return CBO.FillObject(Of PageInfo)(DataProvider.Instance().GetPage(pageId))

End Function

Expand Down
2 changes: 1 addition & 1 deletion Components/CustomFields/CustomFieldController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Namespace Ventrian.NewsArticles.Components.CustomFields

Public Function [Get](ByVal customFieldID As Integer) As CustomFieldInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetCustomField(customFieldID), GetType(CustomFieldInfo)), CustomFieldInfo)
Return CBO.FillObject(Of CustomFieldInfo)(DataProvider.Instance().GetCustomField(customFieldID))

End Function

Expand Down
2 changes: 1 addition & 1 deletion Components/Handout/HandoutController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Namespace Ventrian.NewsArticles

Public Function GetHandout(ByVal handoutID As Integer) As HandoutInfo

Dim objHandout As HandoutInfo = CType(CBO.FillObject(DataProvider.Instance().GetHandout(handoutID), GetType(HandoutInfo)), HandoutInfo)
Dim objHandout As HandoutInfo = CBO.FillObject(Of HandoutInfo)(DataProvider.Instance().GetHandout(handoutID))

objHandout.Articles = CBO.FillCollection(Of HandoutArticle)(DataProvider.Instance().GetHandoutArticleList(handoutID))

Expand Down
2 changes: 1 addition & 1 deletion Components/ImageController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Namespace Ventrian.NewsArticles

Public Function [Get](ByVal imageID As Integer) As ImageInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetImage(imageID), GetType(ImageInfo)), ImageInfo)
Return CBO.FillObject(Of ImageInfo)(DataProvider.Instance().GetImage(imageID))

End Function

Expand Down
2 changes: 1 addition & 1 deletion Components/Import/FeedController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Namespace Ventrian.NewsArticles.Import

Public Function [Get](ByVal feedID As Integer) As FeedInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetFeed(feedID), GetType(FeedInfo)), FeedInfo)
Return CBO.FillObject(Of FeedInfo)(DataProvider.Instance().GetFeed(feedID))

End Function

Expand Down
2 changes: 1 addition & 1 deletion Components/MirrorArticleController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Namespace Ventrian.NewsArticles

Public Function GetMirrorArticle(ByVal articleID As Integer) As MirrorArticleInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetMirrorArticle(articleID), GetType(MirrorArticleInfo)), MirrorArticleInfo)
Return CBO.FillObject(Of MirrorArticleInfo)(DataProvider.Instance().GetMirrorArticle(articleID))

End Function

Expand Down
6 changes: 3 additions & 3 deletions Components/MirrorArticleInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Imports System
Imports System.Data
Imports System.Linq

Imports DotNetNuke
Imports DotNetNuke.Common.Utilities
Expand Down Expand Up @@ -83,11 +84,10 @@ Namespace Ventrian.NewsArticles
If (objPortal IsNot Nothing) Then
_portalName = objPortal.PortalName

Dim o As New PortalAliasController
Dim portalAliases As ArrayList = o.GetPortalAliasArrayByPortalID(_linkedPortalID)
Dim portalAliases As IEnumerable(Of PortalAliasInfo) = PortalAliasController.Instance.GetPortalAliasesByPortalId(_linkedPortalID)

If (portalAliases.Count > 0) Then
_portalName = DotNetNuke.Common.AddHTTP(CType(portalAliases(0), PortalAliasInfo).HTTPAlias)
_portalName = DotNetNuke.Common.AddHTTP(portalAliases(0).HTTPAlias)
End If
End If
End If
Expand Down
4 changes: 2 additions & 2 deletions Components/RatingController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Namespace Ventrian.NewsArticles
Dim objRating As RatingInfo = CType(DataCache.GetCache(cacheKey), RatingInfo)

If (objRating Is Nothing) Then
objRating = CType(CBO.FillObject(DataProvider.Instance().GetRating(articleID, userID), GetType(RatingInfo)), RatingInfo)
objRating = CBO.FillObject(Of RatingInfo)(DataProvider.Instance().GetRating(articleID, userID))
If (objRating IsNot Nothing) Then
DataCache.SetCache(cacheKey, objRating)
Else
Expand All @@ -77,7 +77,7 @@ Namespace Ventrian.NewsArticles
Dim objRating As RatingInfo = CType(DataCache.GetCache(cacheKey), RatingInfo)

If (objRating Is Nothing) Then
objRating = CType(CBO.FillObject(DataProvider.Instance().GetRatingByID(ratingID), GetType(RatingInfo)), RatingInfo)
objRating = CBO.FillObject(Of RatingInfo)(DataProvider.Instance().GetRatingByID(ratingID))
DataCache.SetCache(cacheKey, objRating)
End If

Expand Down
6 changes: 3 additions & 3 deletions Components/TagController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Namespace Ventrian.NewsArticles

Public Function [Get](ByVal tagID As Integer) As TagInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetTag(tagID), GetType(TagInfo)), TagInfo)
Return CBO.FillObject(Of TagInfo)(DataProvider.Instance().GetTag(tagID))

End Function

Expand All @@ -39,7 +39,7 @@ Namespace Ventrian.NewsArticles
Dim objTag As TagInfo = CType(DataCache.GetCache("Tag-" & moduleID.ToString() & "-" & nameLowered), TagInfo)

If (objTag Is Nothing) Then
objTag = CType(CBO.FillObject(DataProvider.Instance().GetTagByName(moduleID, nameLowered), GetType(TagInfo)), TagInfo)
objTag = CBO.FillObject(Of TagInfo)(DataProvider.Instance().GetTagByName(moduleID, nameLowered))
If Not (objTag Is Nothing) Then
DataCache.SetCache("Tag-" & moduleID.ToString() & "-" & nameLowered, objTag)
End If
Expand All @@ -57,7 +57,7 @@ Namespace Ventrian.NewsArticles

Public Function Add(ByVal objTag As TagInfo) As Integer

Return CType(DataProvider.Instance().AddTag(objTag.ModuleID, objTag.Name, objTag.NameLowered), Integer)
Return DataProvider.Instance().AddTag(objTag.ModuleID, objTag.Name, objTag.NameLowered)

End Function

Expand Down
2 changes: 1 addition & 1 deletion Controls/UploadImages.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Namespace Ventrian.NewsArticles.Controls
width = Convert.ToInt32(objImage.Width / (objImage.Height / height))
End If

Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings()
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings()

Return Page.ResolveUrl("~/DesktopModules/DnnForge - NewsArticles/ImageHandler.ashx?Width=" & width.ToString() & "&Height=" & height.ToString() & "&HomeDirectory=" & Server.UrlEncode(settings.HomeDirectory) & "&FileName=" & Server.UrlEncode(objImage.Folder & objImage.FileName) & "&PortalID=" & settings.PortalId.ToString() & "&q=1")

Expand Down
Binary file modified Installs/NewsArticles.00.10.00.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion Providers/FileProvider/FileController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Namespace Ventrian.NewsArticles

Public Function [Get](ByVal fileID As Integer) As FileInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetFile(fileID), GetType(FileInfo)), FileInfo)
Return CBO.FillObject(Of FileInfo)(DataProvider.Instance().GetFile(fileID))

End Function

Expand Down
2 changes: 1 addition & 1 deletion Ventrian.NewsArticles.vbproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
<UseIISExpress>false</UseIISExpress>
<Use64BitIISExpress />
Expand Down
2 changes: 1 addition & 1 deletion ucApproveArticles.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Namespace Ventrian.NewsArticles

Dim objRoleController As New RoleController()

Dim objRoles As ArrayList = objRoleController.GetRoles()
Dim objRoles As IList(Of RoleInfo) = objRoleController.GetRoles(PortalId)
For Each objRole As RoleInfo In objRoles
Dim roleAccess As Boolean = False

Expand Down
3 changes: 1 addition & 2 deletions ucEditCategory.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ Namespace Ventrian.NewsArticles

Private Sub BindRoles()

Dim objRole As New RoleController
Dim availableRoles As New ArrayList
Dim roles As ArrayList = objRole.GetPortalRoles(PortalId)
Dim roles As IList(Of RoleInfo) = RoleController.Instance.GetRoles(PortalId)

If Not roles Is Nothing Then
For Each Role As RoleInfo In roles
Expand Down
2 changes: 1 addition & 1 deletion ucSubmitNews.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ Namespace Ventrian.NewsArticles

Dim objRoleController As New RoleController()

Dim objRoles As ArrayList = objRoleController.GetRoles()
Dim objRoles As IList(Of RoleInfo) = RoleController.Instance.GetRoles(PortalId)
For Each objRole As RoleInfo In objRoles
Dim roleAccess As Boolean = False

Expand Down
13 changes: 6 additions & 7 deletions ucViewOptions.ascx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'

Imports System.IO
Imports System.Linq

Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Expand Down Expand Up @@ -72,13 +73,12 @@ Namespace Ventrian.NewsArticles

Private Sub BindRoles()

Dim objRole As New RoleController

Dim availableRoles As ArrayList = New ArrayList
Dim roles As ArrayList
Dim roles As IList(Of RoleInfo)
If (drpSecurityRoleGroups.SelectedValue = "-1") Then
roles = objRole.GetPortalRoles(PortalId)
roles = RoleController.Instance.GetRoles(PortalId)
Else
Dim objRole As New RoleController
roles = objRole.GetRolesByGroup(PortalId, Convert.ToInt32(drpSecurityRoleGroups.SelectedValue))
End If

Expand Down Expand Up @@ -1473,10 +1473,9 @@ Namespace Ventrian.NewsArticles
If (add) Then
Dim objListItem As New ListItem
objListItem.Value = objPortal.PortalID.ToString() & "-" & objTab.TabID.ToString() & "-" & objModule.ModuleID.ToString()
Dim o As New PortalAliasController
Dim aliases As ArrayList = o.GetPortalAliasArrayByPortalID(objPortal.PortalID)
Dim aliases As IEnumerable(Of PortalAliasInfo) = PortalAliasController.Instance.GetPortalAliasesByPortalId(objPortal.PortalID)
If (aliases.Count > 0) Then
objListItem.Text = DotNetNuke.Common.AddHTTP(CType(aliases(0), PortalAliasInfo).HTTPAlias) & " -> " & strPath & " -> " & objModule.ModuleTitle
objListItem.Text = DotNetNuke.Common.AddHTTP(aliases(0).HTTPAlias) & " -> " & strPath & " -> " & objModule.ModuleTitle
Else
objListItem.Text = objPortal.PortalName & " -> " & strPath & " -> " & objModule.ModuleTitle
End If
Expand Down

0 comments on commit 684a2d7

Please sign in to comment.