minor cleanup

This commit is contained in:
Jesse Plamondon-Willard 2017-04-23 23:00:51 -04:00
parent 8ec607ba3c
commit a9c220c0fe
3 changed files with 4 additions and 6 deletions

View File

@ -626,9 +626,8 @@ namespace StardewModdingApi.Installer
private void Move(FileSystemInfo entry, string newPath) private void Move(FileSystemInfo entry, string newPath)
{ {
// file // file
if (entry is FileInfo) if (entry is FileInfo file)
{ {
FileInfo file = (FileInfo)entry;
file.CopyTo(newPath); file.CopyTo(newPath);
file.Delete(); file.Delete();
} }

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Linq;
using StardewModdingAPI.Framework; using StardewModdingAPI.Framework;
namespace StardewModdingAPI.Events namespace StardewModdingAPI.Events
@ -21,11 +20,11 @@ namespace StardewModdingAPI.Events
internal static event EventHandler InitializeInternal; internal static event EventHandler InitializeInternal;
/// <summary>Raised during launch after configuring XNA or MonoGame. The game window hasn't been opened by this point. Called after <see cref="Microsoft.Xna.Framework.Game.Initialize"/>.</summary> /// <summary>Raised during launch after configuring XNA or MonoGame. The game window hasn't been opened by this point. Called after <see cref="Microsoft.Xna.Framework.Game.Initialize"/>.</summary>
[Obsolete("The " + nameof(Mod) + "." + nameof(Mod.Entry) + " method is now called after the " + nameof(Initialize) + " event, so any contained logic can be done directly in " + nameof(Mod.Entry) + ".")] [Obsolete("The " + nameof(Mod) + "." + nameof(Mod.Entry) + " method is now called after the " + nameof(GameEvents.Initialize) + " event, so any contained logic can be done directly in " + nameof(Mod.Entry) + ".")]
public static event EventHandler Initialize; public static event EventHandler Initialize;
/// <summary>Raised before XNA loads or reloads graphics resources. Called during <see cref="Microsoft.Xna.Framework.Game.LoadContent"/>.</summary> /// <summary>Raised before XNA loads or reloads graphics resources. Called during <see cref="Microsoft.Xna.Framework.Game.LoadContent"/>.</summary>
[Obsolete("The " + nameof(Mod) + "." + nameof(Mod.Entry) + " method is now called after the " + nameof(LoadContent) + " event, so any contained logic can be done directly in " + nameof(Mod.Entry) + ".")] [Obsolete("The " + nameof(Mod) + "." + nameof(Mod.Entry) + " method is now called after the " + nameof(GameEvents.LoadContent) + " event, so any contained logic can be done directly in " + nameof(Mod.Entry) + ".")]
public static event EventHandler LoadContent; public static event EventHandler LoadContent;
/// <summary>Raised during launch after configuring Stardew Valley, loading it into memory, and opening the game window. The window is still blank by this point.</summary> /// <summary>Raised during launch after configuring Stardew Valley, loading it into memory, and opening the game window. The window is still blank by this point.</summary>

View File

@ -35,7 +35,7 @@ namespace StardewModdingAPI.Framework
}; };
/// <summary>A delegate which requests that SMAPI immediately exit the game. This should only be invoked when an irrecoverable fatal error happens that risks save corruption or game-breaking bugs.</summary> /// <summary>A delegate which requests that SMAPI immediately exit the game. This should only be invoked when an irrecoverable fatal error happens that risks save corruption or game-breaking bugs.</summary>
private RequestExitDelegate RequestExit; private readonly RequestExitDelegate RequestExit;
/********* /*********