Dalamud/Dalamud/Utility/Signatures/Wrappers/FieldInfoWrapper.cs
goat 448b0d16ea
Add "loading dialog" for service init, unify blocking logic (#1779)
* wip

* hacky fix for overlapping event text in profiler

* move IsResumeGameAfterPluginLoad logic to PluginManager

* fix some warnings

* handle exceptions properly

* remove ability to cancel, rename button to "hide" instead

* undo Dalamud.Service refactor for now

* warnings

* add explainer, show which plugins are still loading

* add some text if loading takes more than 3 minutes

* undo wrong CS merge
2024-04-21 17:28:37 +02:00

41 lines
1,019 B
C#
Executable file

using System.Reflection;
namespace Dalamud.Utility.Signatures.Wrappers;
/// <summary>
/// Class providing information about a field.
/// </summary>
internal sealed class FieldInfoWrapper : IFieldOrPropertyInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="FieldInfoWrapper"/> class.
/// </summary>
/// <param name="info">FieldInfo to populate from.</param>
public FieldInfoWrapper(FieldInfo info)
{
this.Info = info;
}
/// <inheritdoc/>
public string Name => this.Info.Name;
/// <inheritdoc/>
public Type ActualType => this.Info.FieldType;
/// <inheritdoc/>
public bool IsNullable => NullabilityUtil.IsNullable(this.Info);
private FieldInfo Info { get; }
/// <inheritdoc/>
public void SetValue(object? self, object? value)
{
this.Info.SetValue(self, value);
}
/// <inheritdoc/>
public T? GetCustomAttribute<T>() where T : Attribute
{
return this.Info.GetCustomAttribute<T>();
}
}