Skip to content

Commit

Permalink
Merge pull request #5525 from bdukes/syndication-docs
Browse files Browse the repository at this point in the history
Resolve warnings in DotNetNuke.Syndication
  • Loading branch information
valadas authored Mar 21, 2023
2 parents 6e34975 + fb02dca commit dd5ab09
Show file tree
Hide file tree
Showing 21 changed files with 1,376 additions and 1,634 deletions.
3 changes: 2 additions & 1 deletion DNN Platform/Library/Services/Syndication/RssHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace DotNetNuke.Services.Syndication
using DotNetNuke.Services.Search.Entities;
using DotNetNuke.Services.Search.Internals;

/// <summary>An HTTP handler for serving an RSS feed.</summary>
public class RssHandler : SyndicationHandlerBase
{
/// <inheritdoc />
Expand Down Expand Up @@ -99,7 +100,7 @@ protected override void OnPreRender(EventArgs ea)
}

/// <summary>Creates an RSS Item.</summary>
/// <param name="searchResult"></param>
/// <param name="searchResult">The search result to convert to an RSS item.</param>
/// <returns>A new <see cref="GenericRssElement"/> instance.</returns>
private GenericRssElement GetRssItem(SearchResult searchResult)
{
Expand Down
113 changes: 53 additions & 60 deletions DNN Platform/Library/Services/Syndication/SyndicationHandlerBase.cs
Original file line number Diff line number Diff line change
@@ -1,66 +1,59 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Services.Syndication
{
using System.Web;
namespace DotNetNuke.Services.Syndication
{
using System.Web;

using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Portals;

public class SyndicationHandlerBase : GenericRssHttpHandlerBase
{
private int moduleId = Null.NullInteger;

private int tabId = Null.NullInteger;

public PortalSettings Settings
{
get
{
return Globals.GetPortalSettings();
}
}

public int TabId
{
get
{
if (this.tabId == Null.NullInteger && this.Request.QueryString["tabid"] != null)
{
if (!int.TryParse(this.Request.QueryString["tabid"], out this.tabId))
{
this.tabId = Null.NullInteger;
}
}

return this.tabId;
}
}

public int ModuleId
{
get
{
if (this.moduleId == Null.NullInteger && this.Request.QueryString["moduleid"] != null)
{
if (!int.TryParse(this.Request.QueryString["moduleid"], out this.moduleId))
{
this.moduleId = Null.NullInteger;
}
}

return this.moduleId;
}
}

public HttpRequest Request
{
get
{
return HttpContext.Current.Request;
}
}
}
}
/// <summary>An HTTP handler for generating an RSS feed.</summary>
public class SyndicationHandlerBase : GenericRssHttpHandlerBase
{
private int moduleId = Null.NullInteger;

private int tabId = Null.NullInteger;

/// <summary>Gets the portal settings.</summary>
public PortalSettings Settings => Globals.GetPortalSettings();

/// <summary>Gets the tab ID of the request.</summary>
public int TabId
{
get
{
if (this.tabId == Null.NullInteger && this.Request.QueryString["tabid"] != null)
{
if (!int.TryParse(this.Request.QueryString["tabid"], out this.tabId))
{
this.tabId = Null.NullInteger;
}
}

return this.tabId;
}
}

/// <summary>Gets the module ID of the request.</summary>
public int ModuleId
{
get
{
if (this.moduleId == Null.NullInteger && this.Request.QueryString["moduleid"] != null)
{
if (!int.TryParse(this.Request.QueryString["moduleid"], out this.moduleId))
{
this.moduleId = Null.NullInteger;
}
}

return this.moduleId;
}
}

/// <summary>Gets the HTTP request.</summary>
public HttpRequest Request => HttpContext.Current.Request;
}
}
2 changes: 2 additions & 0 deletions DNN Platform/Syndication/DotNetNuke.Syndication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<DocumentationFile>bin\DotNetNuke.Services.Syndication.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
<LangVersion>7</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -55,6 +56,7 @@
<DocumentationFile>bin\DotNetNuke.Services.Syndication.xml</DocumentationFile>
<Optimize>true</Optimize>
<LangVersion>7</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetNuke.Instrumentation">
Expand Down
Loading

0 comments on commit dd5ab09

Please # to comment.