Enable nullabe reference types for MediaBrowser.Model

This commit is contained in:
Bond_009
2020-04-05 18:10:56 +02:00
parent 29539174a3
commit 30ce346f34
208 changed files with 636 additions and 506 deletions

View File

@@ -1,5 +1,3 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.Threading;
@@ -8,16 +6,19 @@ using System.Threading.Tasks;
namespace MediaBrowser.Model.Tasks
{
/// <summary>
/// Interface IScheduledTaskWorker
/// Interface IScheduledTaskWorker.
/// </summary>
public interface IScheduledTask
{
/// <summary>
/// Gets the name of the task
/// Gets the name of the task.
/// </summary>
/// <value>The name.</value>
string Name { get; }
/// <summary>
/// Gets the key of the task.
/// </summary>
string Key { get; }
/// <summary>
@@ -33,7 +34,7 @@ namespace MediaBrowser.Model.Tasks
string Category { get; }
/// <summary>
/// Executes the task
/// Executes the task.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>

View File

@@ -1,3 +1,4 @@
#nullable disable
using System;
using MediaBrowser.Model.Events;

View File

@@ -14,9 +14,7 @@ namespace MediaBrowser.Model.Tasks
{
var isHidden = false;
var configurableTask = task.ScheduledTask as IConfigurableScheduledTask;
if (configurableTask != null)
if (task.ScheduledTask is IConfigurableScheduledTask configurableTask)
{
isHidden = configurableTask.IsHidden;
}

View File

@@ -6,8 +6,14 @@ namespace MediaBrowser.Model.Tasks
{
public class TaskCompletionEventArgs : EventArgs
{
public IScheduledTaskWorker Task { get; set; }
public TaskCompletionEventArgs(IScheduledTaskWorker task, TaskResult result)
{
Task = task;
Result = result;
}
public TaskResult Result { get; set; }
public IScheduledTaskWorker Task { get; }
public TaskResult Result { get; }
}
}

View File

@@ -1,3 +1,4 @@
#nullable disable
using System;
namespace MediaBrowser.Model.Tasks

View File

@@ -1,3 +1,4 @@
#nullable disable
using System;
namespace MediaBrowser.Model.Tasks

View File

@@ -1,3 +1,4 @@
#nullable disable
#pragma warning disable CS1591
using System;