diff --git a/src/Persistence/EntityFramework/Model/PlugInConfiguration.Custom.cs b/src/Persistence/EntityFramework/Model/PlugInConfiguration.Custom.cs new file mode 100644 index 000000000..d67d97c5c --- /dev/null +++ b/src/Persistence/EntityFramework/Model/PlugInConfiguration.Custom.cs @@ -0,0 +1,17 @@ +// +// Licensed under the MIT License. See LICENSE file in the project root for full license information. +// + +namespace MUnique.OpenMU.Persistence.EntityFramework.Model; + +/// +/// Custom additions to the generated . +/// +internal partial class PlugInConfiguration +{ + /// + public override string ToString() + { + return $"{base.ToString()} ({this.Id})"; + } +} \ No newline at end of file diff --git a/src/PlugIns/PlugInConfiguration.cs b/src/PlugIns/PlugInConfiguration.cs index 11ff2a8b5..f0c71ef3d 100644 --- a/src/PlugIns/PlugInConfiguration.cs +++ b/src/PlugIns/PlugInConfiguration.cs @@ -70,15 +70,26 @@ public string? CustomConfiguration } } + /// + /// Gets the (display) name of this plugin. + /// + public string Name + { + get + { + var plugInType = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(assembly => assembly.DefinedTypes) + .FirstOrDefault(t => t.GUID == this.TypeId); + var plugInAttribute = plugInType?.GetCustomAttribute(); + + return plugInAttribute?.Name ?? this.TypeId.ToString(); + } + } + /// public override string ToString() { - var plugInType = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(assembly => assembly.DefinedTypes) - .FirstOrDefault(t => t.GUID == this.TypeId); - var plugInAttribute = plugInType?.GetCustomAttribute(); - - return plugInAttribute?.Name ?? this.TypeId.ToString(); + return this.Name; } ///