Magic the magic happen

This commit is contained in:
Raymond Lynch 2021-07-11 16:32:29 -04:00
parent 84769ae5b7
commit 658eedca37
188 changed files with 10329 additions and 3549 deletions

View file

@ -0,0 +1,26 @@
namespace Dalamud.Plugin.Internal.Exceptions
{
/// <summary>
/// This exception that is thrown when a plugin is instructed to load while another plugin with the same
/// assembly name is already present and loaded.
/// </summary>
internal class DuplicatePluginException : PluginException
{
/// <summary>
/// Initializes a new instance of the <see cref="DuplicatePluginException"/> class.
/// </summary>
/// <param name="assemblyName">Name of the conflicting assembly.</param>
public DuplicatePluginException(string assemblyName)
{
this.AssemblyName = assemblyName;
}
/// <summary>
/// Gets the name of the conflicting assembly.
/// </summary>
public string AssemblyName { get; init; }
/// <inheritdoc/>
public override string Message => $"A plugin with the same assembly name of {this.AssemblyName} is already loaded";
}
}

View file

@ -0,0 +1,25 @@
using System;
using System.IO;
namespace Dalamud.Plugin.Internal.Exceptions
{
/// <summary>
/// This exception represents a file that does not implement IDalamudPlugin.
/// </summary>
internal class InvalidPluginException : PluginException
{
/// <summary>
/// Initializes a new instance of the <see cref="InvalidPluginException"/> class.
/// </summary>
/// <param name="dllFile">The invalid file.</param>
public InvalidPluginException(FileInfo dllFile)
{
this.DllFile = dllFile;
}
/// <summary>
/// Gets the invalid file.
/// </summary>
public FileInfo DllFile { get; init; }
}
}

View file

@ -0,0 +1,24 @@
using System;
namespace Dalamud.Plugin.Internal.Exceptions
{
/// <summary>
/// This represents an invalid plugin operation.
/// </summary>
internal class InvalidPluginOperationException : PluginException
{
/// <summary>
/// Initializes a new instance of the <see cref="InvalidPluginOperationException"/> class.
/// </summary>
/// <param name="message">The message describing the invalid operation.</param>
public InvalidPluginOperationException(string message)
{
this.Message = message;
}
/// <summary>
/// Gets the message describing the invalid operation.
/// </summary>
public override string Message { get; }
}
}

View file

@ -0,0 +1,11 @@
using System;
namespace Dalamud.Plugin.Internal.Exceptions
{
/// <summary>
/// This represents the base Dalamud plugin exception.
/// </summary>
internal abstract class PluginException : Exception
{
}
}