diff --git a/BepInEx.Core/Bootstrap/BaseChainloader.cs b/BepInEx.Core/Bootstrap/BaseChainloader.cs
index 3aa6d92d5..8a84abc31 100644
--- a/BepInEx.Core/Bootstrap/BaseChainloader.cs
+++ b/BepInEx.Core/Bootstrap/BaseChainloader.cs
@@ -12,15 +12,18 @@
namespace BepInEx.Bootstrap;
+/// Base chainloader used to load and manage plugins.
public abstract class BaseChainloader
{
+ /// Name of the currently executing BepInEx assembly.
protected static readonly string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name;
+ /// Version of the currently executing BepInEx assembly.
protected static readonly Version CurrentAssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
private static readonly Dictionary RefCache = new();
private static Regex allowedGuidRegex { get; } = new(@"^[a-zA-Z0-9\._\-]+$");
///
- /// Analyzes the given type definition and attempts to convert it to a valid
+ /// Analyzes the given type definition and attempts to convert it to a valid
///
/// Type definition to analyze.
/// The filepath of the assembly, to keep as metadata.
@@ -117,6 +120,9 @@ static bool ReferencesThisAssembly(AssemblyDefinition ass, HashSet seen
}
return RefCache[key] = false;
}
+ /// Checks whether the assembly contains loadable plugins.
+ /// Assembly definition to check.
+ /// True if the assembly references BepInEx and contains plugin types, otherwise false.
protected static bool HasBepinPlugins(AssemblyDefinition ass)
{
if (!ReferencesThisAssembly(ass))
@@ -129,6 +135,9 @@ protected static bool HasBepinPlugins(AssemblyDefinition ass)
return true;
}
+ /// Checks whether the plugin targets an incompatible BepInEx version.
+ /// Plugin metadata to check.
+ /// True if the plugin targets a different BepInEx version, otherwise false.
protected static bool PluginTargetsWrongBepin(PluginInfo pluginInfo)
{
var pluginTarget = pluginInfo.TargettedBepInExVersion;
@@ -141,31 +150,34 @@ protected static bool PluginTargetsWrongBepin(PluginInfo pluginInfo)
#region Contract
+ /// Title displayed on the BepInEx console window.
protected virtual string ConsoleTitle => $"BepInEx {Utility.BepInExVersion} - {Paths.ProcessName}";
private bool _initialized;
///
- /// List of all instances loaded via the chainloader.
+ /// List of all instances loaded via the chainloader.
///
public Dictionary Plugins { get; } = new();
///
- /// Collection of error chainloader messages that occured during plugin loading.
- /// Contains information about what certain plugins were not loaded.
+ /// Collection of error chainloader messages that occured during plugin loading.
+ /// Contains information about what certain plugins were not loaded.
///
public List DependencyErrors { get; } = new();
///
- /// Occurs after a plugin is loaded.
+ /// Occurs after a plugin is loaded.
///
public event Action PluginLoaded;
///
- /// Occurs after all plugins are loaded.
+ /// Occurs after all plugins are loaded.
///
public event Action Finished;
+ /// Initializes the chainloader and loads all plugins.
+ /// Path to the game executable. If null, paths must already be initialized.
public virtual void Initialize(string gameExePath = null)
{
if (_initialized)
@@ -190,6 +202,7 @@ public virtual void Initialize(string gameExePath = null)
Logger.Log(LogLevel.Message, "Chainloader initialized");
}
+ /// Initializes the console and disk loggers.
protected virtual void InitializeLoggers()
{
if (ConsoleManager.ConsoleEnabled && !ConsoleManager.ConsoleActive)
@@ -550,6 +563,10 @@ private static void TryRunModuleCtor(PluginInfo plugin, Assembly assembly)
}
}
+ /// Loads a plugin from the given assembly.
+ /// Metadata of the plugin to load.
+ /// Assembly containing the plugin.
+ /// The loaded plugin instance.
public abstract TPlugin LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly);
#endregion
diff --git a/BepInEx.Core/Bootstrap/TypeLoader.cs b/BepInEx.Core/Bootstrap/TypeLoader.cs
index 175ebaba1..7dba2d932 100644
--- a/BepInEx.Core/Bootstrap/TypeLoader.cs
+++ b/BepInEx.Core/Bootstrap/TypeLoader.cs
@@ -11,64 +11,64 @@
namespace BepInEx.Bootstrap;
///
-/// A cacheable metadata item. Can be used with and
-/// to cache plugin metadata.
+/// A cacheable metadata item. Can be used with and
+/// to cache plugin metadata.
///
public interface ICacheable
{
///
- /// Serialize the object into a binary format.
+ /// Serialize the object into a binary format.
///
///
void Save(BinaryWriter bw);
///
- /// Loads the object from binary format.
+ /// Loads the object from binary format.
///
///
void Load(BinaryReader br);
}
///
-/// A cached assembly.
+/// A cached assembly.
///
///
public class CachedAssembly where T : ICacheable
{
///
- /// List of cached items inside the assembly.
+ /// List of cached items inside the assembly.
///
public List CacheItems { get; set; }
///
- /// Hash of the assembly. Used to verify that the assembly hasn't been changed.
+ /// Hash of the assembly. Used to verify that the assembly hasn't been changed.
///
public string Hash { get; set; }
}
///
-/// Provides methods for loading specified types from an assembly.
+/// Provides methods for loading specified types from an assembly.
///
public static class TypeLoader
{
///
- /// Default assembly resolved used by the
+ /// Default assembly resolved used by the
///
public static readonly DefaultAssemblyResolver CecilResolver;
///
- /// Default reader parameters used by
+ /// Default reader parameters used by
///
public static readonly ReaderParameters ReaderParameters;
+ /// Additional directories searched when resolving assemblies.
public static HashSet SearchDirectories = new();
private static readonly Dictionary AssemblyPathByName = new(StringComparer.InvariantCultureIgnoreCase);
///
- /// Maps every managed assembly file in a directory to its assembly name, so files whose
- /// filename does not match the assembly name (e.g. renamed by the user) still resolve.
- /// First file wins when two files share an assembly name.
+ /// Maps every managed assembly file in a directory to its assembly name, so files whose filename does not match the assembly name (e.g. renamed by the user) still resolve.
+ /// First file wins when two files share an assembly name.
///
public static void RegisterAssemblyPaths(string directory)
{
@@ -92,6 +92,10 @@ public static void RegisterAssemblyPaths(string directory)
}
}
+ /// Tries to get the registered file path of an assembly.
+ /// Name of the assembly to look up.
+ /// File path of the assembly, if registered.
+ /// True if the assembly path was found and exists, otherwise false.
public static bool TryGetRegisteredAssemblyPath(string name, out string path) =>
AssemblyPathByName.TryGetValue(name, out path) && File.Exists(path);
@@ -112,6 +116,10 @@ static TypeLoader()
CecilResolver.ResolveFailure += CecilResolveOnFailure;
}
+ /// Resolves Cecil assembly references that failed the default resolution.
+ /// Source of the event.
+ /// Reference of the assembly that failed to resolve.
+ /// The resolved assembly definition, or null if it could not be resolved.
public static AssemblyDefinition CecilResolveOnFailure(object sender, AssemblyNameReference reference)
{
if (!Utility.TryParseAssemblyName(reference.FullName, out var name))
@@ -149,12 +157,12 @@ public static AssemblyDefinition CecilResolveOnFailure(object sender, AssemblyNa
}
///
- /// Event fired when fails to resolve a type during type loading.
+ /// Event fired when fails to resolve a type during type loading.
///
public static event AssemblyResolveEventHandler AssemblyResolve;
///
- /// Looks up assemblies in the given directory and locates all types that can be loaded and collects their metadata.
+ /// Looks up assemblies in the given directory and locates all types that can be loaded and collects their metadata.
///
/// The specific base type to search for.
/// The directory to search for assemblies.
@@ -162,8 +170,7 @@ public static AssemblyDefinition CecilResolveOnFailure(object sender, AssemblyNa
/// A filter function to quickly determine if the assembly can be loaded.
/// The name of the cache to get cached types from.
///
- /// A dictionary of all assemblies in the directory and the list of type metadatas of types that match the
- /// selector.
+ /// A dictionary of all assemblies in the directory and the list of type metadatas of types that match the selector.
///
public static Dictionary> FindPluginTypes(string directory,
Func typeSelector,
@@ -224,13 +231,12 @@ public static Dictionary> FindPluginTypes(string directory,
}
///
- /// Loads an index of type metadatas from a cache.
+ /// Loads an index of type metadatas from a cache.
///
/// Name of the cache
/// Cacheable item
///
- /// Cached type metadatas indexed by the path of the assembly that defines the type. If no cache is defined,
- /// return null.
+ /// Cached type metadatas indexed by the path of the assembly that defines the type. If no cache is defined, return null.
///
public static Dictionary> LoadAssemblyCache(string cacheName)
where T : ICacheable, new()
@@ -277,7 +283,7 @@ public static Dictionary> LoadAssemblyCache(string
}
///
- /// Saves indexed type metadata into a cache.
+ /// Saves indexed type metadata into a cache.
///
/// Name of the cache
/// List of plugin metadatas indexed by the path to the assembly that contains the types
@@ -319,7 +325,7 @@ public static void SaveAssemblyCache(string cacheName,
}
///
- /// Converts TypeLoadException to a readable string.
+ /// Converts TypeLoadException to a readable string.
///
/// TypeLoadException
/// Readable representation of the exception
diff --git a/BepInEx.Core/Configuration/AcceptableValueBase.cs b/BepInEx.Core/Configuration/AcceptableValueBase.cs
index e48354a3f..b67a9e679 100644
--- a/BepInEx.Core/Configuration/AcceptableValueBase.cs
+++ b/BepInEx.Core/Configuration/AcceptableValueBase.cs
@@ -3,7 +3,7 @@
namespace BepInEx.Configuration;
///
-/// Base type of all classes representing and enforcing acceptable values of config settings.
+/// Base type of all classes representing and enforcing acceptable values of config settings.
///
public abstract class AcceptableValueBase
{
@@ -14,22 +14,22 @@ protected AcceptableValueBase(Type valueType)
}
///
- /// Type of the supported values.
+ /// Type of the supported values.
///
public Type ValueType { get; }
///
- /// Change the value to be acceptable, if it's not already.
+ /// Change the value to be acceptable, if it's not already.
///
public abstract object Clamp(object value);
///
- /// Check if the value is an acceptable value.
+ /// Check if the value is an acceptable value.
///
public abstract bool IsValid(object value);
///
- /// Get the string for use in config files.
+ /// Get the string for use in config files.
///
public abstract string ToDescriptionString();
}
diff --git a/BepInEx.Core/Configuration/AcceptableValueList.cs b/BepInEx.Core/Configuration/AcceptableValueList.cs
index 5770a983d..cb737f81a 100644
--- a/BepInEx.Core/Configuration/AcceptableValueList.cs
+++ b/BepInEx.Core/Configuration/AcceptableValueList.cs
@@ -4,13 +4,13 @@
namespace BepInEx.Configuration;
///
-/// Specify the list of acceptable values for a setting.
+/// Specify the list of acceptable values for a setting.
///
public class AcceptableValueList : AcceptableValueBase where T : IEquatable
{
///
- /// Specify the list of acceptable values for a setting.
- /// If the setting does not equal any of the values, it will be set to the first one.
+ /// Specify the list of acceptable values for a setting.
+ /// If the setting does not equal any of the values, it will be set to the first one.
///
public AcceptableValueList(params T[] acceptableValues) : base(typeof(T))
{
@@ -22,7 +22,7 @@ public AcceptableValueList(params T[] acceptableValues) : base(typeof(T))
}
///
- /// List of values that a setting can take.
+ /// List of values that a setting can take.
///
public virtual T[] AcceptableValues { get; }
diff --git a/BepInEx.Core/Configuration/AcceptableValueRange.cs b/BepInEx.Core/Configuration/AcceptableValueRange.cs
index 2a3ddf46c..e9ba4471e 100644
--- a/BepInEx.Core/Configuration/AcceptableValueRange.cs
+++ b/BepInEx.Core/Configuration/AcceptableValueRange.cs
@@ -3,7 +3,7 @@
namespace BepInEx.Configuration;
///
-/// Specify the range of acceptable values for a setting.
+/// Specify the range of acceptable values for a setting.
///
public class AcceptableValueRange : AcceptableValueBase where T : IComparable
{
@@ -23,12 +23,12 @@ public AcceptableValueRange(T minValue, T maxValue) : base(typeof(T))
}
///
- /// Lowest acceptable value
+ /// Lowest acceptable value
///
public virtual T MinValue { get; }
///
- /// Highest acceptable value
+ /// Highest acceptable value
///
public virtual T MaxValue { get; }
diff --git a/BepInEx.Core/Configuration/ConfigDefinition.cs b/BepInEx.Core/Configuration/ConfigDefinition.cs
index d963c196c..3166c1bf1 100644
--- a/BepInEx.Core/Configuration/ConfigDefinition.cs
+++ b/BepInEx.Core/Configuration/ConfigDefinition.cs
@@ -4,9 +4,9 @@
namespace BepInEx.Configuration;
///
-/// Section and key of a setting. Used as a unique key for identification within a
-/// .
-/// The same definition can be used in multiple config files, it will point to different settings then.
+/// Section and key of a setting. Used as a unique key for identification within a
+/// .
+/// The same definition can be used in multiple config files, it will point to different settings then.
///
///
public class ConfigDefinition : IEquatable
@@ -14,7 +14,7 @@ public class ConfigDefinition : IEquatable
private static readonly char[] _invalidConfigChars = { '=', '\n', '\t', '\\', '"', '\'', '[', ']' };
///
- /// Create a new definition. Definitions with same section and key are equal.
+ /// Create a new definition. Definitions with same section and key are equal.
///
/// Group of the setting, case sensitive.
/// Name of the setting, case sensitive.
@@ -35,17 +35,17 @@ public ConfigDefinition(string section, string key, string description)
}
///
- /// Group of the setting. All settings within a config file are grouped by this.
+ /// Group of the setting. All settings within a config file are grouped by this.
///
public string Section { get; }
///
- /// Name of the setting.
+ /// Name of the setting.
///
public string Key { get; }
///
- /// Check if the definitions are the same.
+ /// Check if the definitions are the same.
///
///
public bool Equals(ConfigDefinition other)
@@ -68,7 +68,7 @@ private static void CheckInvalidConfigChars(string val, string name)
}
///
- /// Check if the definitions are the same.
+ /// Check if the definitions are the same.
///
public override bool Equals(object obj)
{
@@ -92,12 +92,12 @@ public override int GetHashCode()
}
///
- /// Check if the definitions are the same.
+ /// Check if the definitions are the same.
///
public static bool operator ==(ConfigDefinition left, ConfigDefinition right) => Equals(left, right);
///
- /// Check if the definitions are the same.
+ /// Check if the definitions are the same.
///
public static bool operator !=(ConfigDefinition left, ConfigDefinition right) => !Equals(left, right);
diff --git a/BepInEx.Core/Configuration/ConfigDescription.cs b/BepInEx.Core/Configuration/ConfigDescription.cs
index ce4d9f942..d2945ce85 100644
--- a/BepInEx.Core/Configuration/ConfigDescription.cs
+++ b/BepInEx.Core/Configuration/ConfigDescription.cs
@@ -3,18 +3,15 @@
namespace BepInEx.Configuration;
///
-/// Metadata of a .
+/// Metadata of a .
///
public class ConfigDescription
{
///
- /// Create a new description.
+ /// Create a new description.
///
/// Text describing the function of the setting and any notes or warnings.
- ///
- /// Range of values that this setting can take. The setting's value will be automatically
- /// clamped.
- ///
+ /// Range of values that this setting can take. The setting's value will be automatically clamped.
/// Objects that can be used by user-made classes to add functionality.
public ConfigDescription(string description, AcceptableValueBase acceptableValues = null, params object[] tags)
{
@@ -24,22 +21,22 @@ public ConfigDescription(string description, AcceptableValueBase acceptableValue
}
///
- /// Text describing the function of the setting and any notes or warnings.
+ /// Text describing the function of the setting and any notes or warnings.
///
public string Description { get; }
///
- /// Range of acceptable values for a setting.
+ /// Range of acceptable values for a setting.
///
public AcceptableValueBase AcceptableValues { get; }
///
- /// Objects that can be used by user-made classes to add functionality.
+ /// Objects that can be used by user-made classes to add functionality.
///
public object[] Tags { get; }
///
- /// An empty description.
+ /// An empty description.
///
public static ConfigDescription Empty { get; } = new("");
}
diff --git a/BepInEx.Core/Configuration/ConfigEntryBase.cs b/BepInEx.Core/Configuration/ConfigEntryBase.cs
index a4b44fbd0..d4d043059 100644
--- a/BepInEx.Core/Configuration/ConfigEntryBase.cs
+++ b/BepInEx.Core/Configuration/ConfigEntryBase.cs
@@ -6,7 +6,7 @@
namespace BepInEx.Configuration;
///
-/// Provides access to a single setting inside of a .
+/// Provides access to a single setting inside of a .
///
/// Type of the setting.
public sealed class ConfigEntry : ConfigEntryBase
@@ -26,7 +26,7 @@ internal ConfigEntry(ConfigFile configFile,
}
///
- /// Value of this setting.
+ /// Value of this setting.
///
public T Value
{
@@ -50,19 +50,19 @@ public override object BoxedValue
}
///
- /// Fired when the setting is changed. Does not detect changes made outside from this object.
+ /// Fired when the setting is changed. Does not detect changes made outside from this object.
///
public event EventHandler SettingChanged;
}
///
-/// Container for a single setting of a .
-/// Each config entry is linked to one config file.
+/// Container for a single setting of a .
+/// Each config entry is linked to one config file.
///
public abstract class ConfigEntryBase
{
///
- /// Types of defaultValue and definition.AcceptableValues have to be the same as settingType.
+ /// Types of defaultValue and definition.AcceptableValues have to be the same as settingType.
///
internal protected ConfigEntryBase(ConfigFile configFile,
ConfigDefinition definition,
@@ -87,43 +87,43 @@ internal protected ConfigEntryBase(ConfigFile configFile,
}
///
- /// Config file this entry is a part of.
+ /// Config file this entry is a part of.
///
public ConfigFile ConfigFile { get; }
///
- /// Category and name of this setting. Used as a unique key for identification within a
- /// .
+ /// Category and name of this setting. Used as a unique key for identification within a
+ /// .
///
public ConfigDefinition Definition { get; }
///
- /// Description / metadata of this setting.
+ /// Description / metadata of this setting.
///
public ConfigDescription Description { get; }
///
- /// Type of the that this setting holds.
+ /// Type of the that this setting holds.
///
public Type SettingType { get; }
///
- /// Default value of this setting (set only if the setting was not changed before).
+ /// Default value of this setting (set only if the setting was not changed before).
///
public object DefaultValue { get; }
///
- /// Get or set the value of the setting.
+ /// Get or set the value of the setting.
///
public abstract object BoxedValue { get; set; }
///
- /// Get the serialized representation of the value.
+ /// Get the serialized representation of the value.
///
public string GetSerializedValue() => TomlTypeConverter.ConvertToString(BoxedValue, SettingType);
///
- /// Set the value by using its serialized form.
+ /// Set the value by using its serialized form.
///
public void SetSerializedValue(string value)
{
@@ -140,7 +140,7 @@ public void SetSerializedValue(string value)
}
///
- /// If necessary, clamp the value to acceptable value range. T has to be equal to settingType.
+ /// If necessary, clamp the value to acceptable value range. T has to be equal to settingType.
///
protected T ClampValue(T value)
{
@@ -150,12 +150,12 @@ protected T ClampValue(T value)
}
///
- /// Trigger setting changed event.
+ /// Trigger setting changed event.
///
protected void OnSettingChanged(object sender) => ConfigFile.OnSettingChanged(sender, this);
///
- /// Write a description of this setting using all available metadata.
+ /// Write a description of this setting using all available metadata.
///
public void WriteDescription(StreamWriter writer)
{
diff --git a/BepInEx.Core/Configuration/ConfigFile.cs b/BepInEx.Core/Configuration/ConfigFile.cs
index dfa756be9..980d37231 100644
--- a/BepInEx.Core/Configuration/ConfigFile.cs
+++ b/BepInEx.Core/Configuration/ConfigFile.cs
@@ -9,7 +9,7 @@
namespace BepInEx.Configuration;
///
-/// A helper class to handle persistent data. All public methods are thread-safe.
+/// A helper class to handle persistent data. All public methods are thread-safe.
///
public class ConfigFile : IDictionary
{
@@ -19,7 +19,7 @@ public class ConfigFile : IDictionary
public ConfigFile(string configPath, bool saveOnInit) : this(configPath, saveOnInit, null) { }
///
- /// Create a new config file at the specified config path.
+ /// Create a new config file at the specified config path.
///
/// Full path to a file that contains settings. The file will be created as needed.
/// If the config file/directory doesn't exist, create it immediately.
@@ -37,17 +37,18 @@ public ConfigFile(string configPath, bool saveOnInit, BepInPlugin ownerMetadata)
else if (saveOnInit) TrySave();
}
+ /// Config file holding the core BepInEx settings.
public static ConfigFile CoreConfig { get; } = new(Paths.BepInExConfigPath, true);
///
- /// All config entries inside
+ /// All config entries inside
///
protected Dictionary Entries { get; } = new();
private Dictionary OrphanedEntries { get; } = new();
///
- /// Create a list with all config entries inside of this config file.
+ /// Create a list with all config entries inside of this config file.
///
[Obsolete("Use Keys instead")]
public ReadOnlyCollection ConfigDefinitions
@@ -62,14 +63,13 @@ public ReadOnlyCollection ConfigDefinitions
}
///
- /// Full path to the config file. The file might not exist until a setting is added and changed, or
- /// is called.
+ /// Full path to the config file. The file might not exist until a setting is added and changed, or is called.
///
public string ConfigFilePath { get; }
///
- /// If enabled, writes the config to disk every time a value is set.
- /// If disabled, you have to manually use or the changes will be lost!
+ /// If enabled, writes the config to disk every time a value is set.
+ /// If disabled, you have to manually use or the changes will be lost!
///
public bool SaveOnConfigSet { get; set; } = true;
@@ -206,8 +206,8 @@ ConfigEntryBase IDictionary.this[ConfigDefini
}
///
- /// Returns the ConfigDefinitions that the ConfigFile contains.
- /// Creates a new array when the property is accessed. Thread-safe.
+ /// Returns the ConfigDefinitions that the ConfigFile contains.
+ /// Creates a new array when the property is accessed. Thread-safe.
///
public ICollection Keys
{
@@ -221,8 +221,8 @@ public ICollection Keys
}
///
- /// Returns the ConfigEntryBase values that the ConfigFile contains.
- /// Creates a new array when the property is accessed. Thread-safe.
+ /// Returns the ConfigEntryBase values that the ConfigFile contains.
+ /// Creates a new array when the property is accessed. Thread-safe.
///
public ICollection Values
{
@@ -236,10 +236,10 @@ public ICollection Values
}
///
- /// Create an array with all config entries inside of this config file. Should be only used for metadata purposes.
- /// If you want to access and modify an existing setting then use
- ///
- /// instead with no description.
+ /// Create an array with all config entries inside of this config file. Should be only used for metadata purposes.
+ /// If you want to access and modify an existing setting then use
+ ///
+ /// instead with no description.
///
[Obsolete("Use Values instead")]
public ConfigEntryBase[] GetConfigEntries()
@@ -255,12 +255,12 @@ public ConfigEntryBase[] GetConfigEntries()
private readonly object _ioLock = new();
///
- /// Generate user-readable comments for each of the settings in the saved .cfg file.
+ /// Generate user-readable comments for each of the settings in the saved .cfg file.
///
public bool GenerateSettingDescriptions { get; set; } = true;
///
- /// Reloads the config from disk. Unsaved changes are lost.
+ /// Reloads the config from disk. Unsaved changes are lost.
///
public void Reload()
{
@@ -305,7 +305,7 @@ public void Reload()
}
///
- /// Writes the config to disk.
+ /// Writes the config to disk.
///
public void Save()
{
@@ -356,9 +356,7 @@ public void Save()
}
///
- /// Writes the config to disk like , but logs and swallows I/O failures (e.g. a read-only
- /// or locked config file) instead of throwing. Used only for the creation-time saves (initial file write and
- /// new-entry binds), which can run before logging is up; explicit saves and setting changes still throw.
+ /// Writes the config to disk like , but logs and swallows I/O failures (e.g. a read-only or locked config file) instead of throwing. Used only for the creation-time saves (initial file write and new-entry binds), which can run before logging is up; explicit saves and setting changes still throw.
///
private void TrySave()
{
@@ -378,9 +376,9 @@ private void TrySave()
#region Wraps
///
- /// Access one of the existing settings. If the setting has not been added yet, null is returned.
- /// If the setting exists but has a different type than T, an exception is thrown.
- /// New settings should be added with .
+ /// Access one of the existing settings. If the setting has not been added yet, null is returned.
+ /// If the setting exists but has a different type than T, an exception is thrown.
+ /// New settings should be added with .
///
/// Type of the value contained in this setting.
/// Section and Key of the setting.
@@ -391,9 +389,9 @@ public ConfigEntry GetSetting(ConfigDefinition configDefinition) =>
: null;
///
- /// Access one of the existing settings. If the setting has not been added yet, null is returned.
- /// If the setting exists but has a different type than T, an exception is thrown.
- /// New settings should be added with .
+ /// Access one of the existing settings. If the setting has not been added yet, null is returned.
+ /// If the setting exists but has a different type than T, an exception is thrown.
+ /// New settings should be added with .
///
/// Type of the value contained in this setting.
/// Section/category/group of the setting. Settings are grouped by this.
@@ -405,10 +403,10 @@ public ConfigEntry GetSetting(string section, string key) =>
: null;
///
- /// Access one of the existing settings. If the setting has not been added yet, false is returned. Otherwise, true.
- /// If the setting exists but has a different type than T, an exception is thrown.
- /// New settings should be added with
- /// .
+ /// Access one of the existing settings. If the setting has not been added yet, false is returned. Otherwise, true.
+ /// If the setting exists but has a different type than T, an exception is thrown.
+ /// New settings should be added with
+ /// .
///
/// Type of the value contained in this setting.
/// Section and Key of the setting.
@@ -429,10 +427,10 @@ public bool TryGetEntry(ConfigDefinition configDefinition, out ConfigEntry
}
///
- /// Access one of the existing settings. If the setting has not been added yet, null is returned.
- /// If the setting exists but has a different type than T, an exception is thrown.
- /// New settings should be added with
- /// .
+ /// Access one of the existing settings. If the setting has not been added yet, null is returned.
+ /// If the setting exists but has a different type than T, an exception is thrown.
+ /// New settings should be added with
+ /// .
///
/// Type of the value contained in this setting.
/// Section/category/group of the setting. Settings are grouped by this.
@@ -442,8 +440,8 @@ public bool TryGetEntry(string section, string key, out ConfigEntry entry)
TryGetEntry(new ConfigDefinition(section, key), out entry);
///
- /// Create a new setting. The setting is saved to drive and loaded automatically.
- /// Each definition can be used to add only one setting, trying to add a second setting will throw an exception.
+ /// Create a new setting. The setting is saved to drive and loaded automatically.
+ /// Each definition can be used to add only one setting, trying to add a second setting will throw an exception.
///
/// Type of the value contained in this setting.
/// Section and Key of the setting.
@@ -480,9 +478,8 @@ public ConfigEntry Bind(ConfigDefinition configDefinition,
}
///
- /// Create a new setting. The setting is saved to drive and loaded automatically.
- /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an
- /// exception.
+ /// Create a new setting. The setting is saved to drive and loaded automatically.
+ /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an exception.
///
/// Type of the value contained in this setting.
/// Section/category/group of the setting. Settings are grouped by this.
@@ -496,9 +493,8 @@ public ConfigEntry Bind(string section,
Bind(new ConfigDefinition(section, key), defaultValue, configDescription);
///
- /// Create a new setting. The setting is saved to drive and loaded automatically.
- /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an
- /// exception.
+ /// Create a new setting. The setting is saved to drive and loaded automatically.
+ /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an exception.
///
/// Type of the value contained in this setting.
/// Section/category/group of the setting. Settings are grouped by this.
@@ -509,8 +505,8 @@ public ConfigEntry Bind(string section, string key, T defaultValue, string
Bind(new ConfigDefinition(section, key), defaultValue, new ConfigDescription(description));
///
- /// Create a new setting. The setting is saved to drive and loaded automatically.
- /// Each definition can be used to add only one setting, trying to add a second setting will throw an exception.
+ /// Create a new setting. The setting is saved to drive and loaded automatically.
+ /// Each definition can be used to add only one setting, trying to add a second setting will throw an exception.
///
/// Type of the value contained in this setting.
/// Section and Key of the setting.
@@ -523,9 +519,8 @@ public ConfigEntry AddSetting(ConfigDefinition configDefinition,
Bind(configDefinition, defaultValue, configDescription);
///
- /// Create a new setting. The setting is saved to drive and loaded automatically.
- /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an
- /// exception.
+ /// Create a new setting. The setting is saved to drive and loaded automatically.
+ /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an exception.
///
/// Type of the value contained in this setting.
/// Section/category/group of the setting. Settings are grouped by this.
@@ -540,9 +535,8 @@ public ConfigEntry AddSetting(string section,
Bind(new ConfigDefinition(section, key), defaultValue, configDescription);
///
- /// Create a new setting. The setting is saved to drive and loaded automatically.
- /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an
- /// exception.
+ /// Create a new setting. The setting is saved to drive and loaded automatically.
+ /// Each section and key pair can be used to add only one setting, trying to add a second setting will throw an exception.
///
/// Type of the value contained in this setting.
/// Section/category/group of the setting. Settings are grouped by this.
@@ -554,7 +548,7 @@ public ConfigEntry AddSetting(string section, string key, T defaultValue,
Bind(new ConfigDefinition(section, key), defaultValue, new ConfigDescription(description));
///
- /// Access a setting. Use Bind instead.
+ /// Access a setting. Use Bind instead.
///
[Obsolete("Use Bind instead")]
public ConfigWrapper Wrap(string section, string key, string description = null, T defaultValue = default)
@@ -569,7 +563,7 @@ public ConfigWrapper Wrap(string section, string key, string description =
}
///
- /// Access a setting. Use Bind instead.
+ /// Access a setting. Use Bind instead.
///
[Obsolete("Use Bind instead")]
public ConfigWrapper Wrap(ConfigDefinition configDefinition, T defaultValue = default) =>
@@ -580,12 +574,12 @@ public ConfigWrapper Wrap(ConfigDefinition configDefinition, T defaultValu
#region Events
///
- /// An event that is fired every time the config is reloaded.
+ /// An event that is fired every time the config is reloaded.
///
public event EventHandler ConfigReloaded;
///
- /// Fired when one of the settings is changed.
+ /// Fired when one of the settings is changed.
///
public event EventHandler SettingChanged;
diff --git a/BepInEx.Core/Configuration/ConfigWrapper.cs b/BepInEx.Core/Configuration/ConfigWrapper.cs
index 6ba016693..f7751fd3a 100644
--- a/BepInEx.Core/Configuration/ConfigWrapper.cs
+++ b/BepInEx.Core/Configuration/ConfigWrapper.cs
@@ -3,7 +3,7 @@
namespace BepInEx.Configuration;
///
-/// Provides access to a single setting inside of a .
+/// Provides access to a single setting inside of a .
///
/// Type of the setting.
[Obsolete("Use ConfigFile from new Bind overloads instead")]
@@ -20,22 +20,22 @@ internal ConfigWrapper(ConfigEntry configEntry)
}
///
- /// Entry of this setting in the .
+ /// Entry of this setting in the .
///
public ConfigEntry ConfigEntry { get; }
///
- /// Unique definition of this setting.
+ /// Unique definition of this setting.
///
public ConfigDefinition Definition => ConfigEntry.Definition;
///
- /// Config file this setting is inside of.
+ /// Config file this setting is inside of.
///
public ConfigFile ConfigFile => ConfigEntry.ConfigFile;
///
- /// Value of this setting.
+ /// Value of this setting.
///
public T Value
{
@@ -44,7 +44,7 @@ public T Value
}
///
- /// Fired when the setting is changed. Does not detect changes made outside from this object.
+ /// Fired when the setting is changed. Does not detect changes made outside from this object.
///
public event EventHandler SettingChanged;
}
diff --git a/BepInEx.Core/Configuration/SettingChangedEventArgs.cs b/BepInEx.Core/Configuration/SettingChangedEventArgs.cs
index 7e167eca8..ccb29e746 100644
--- a/BepInEx.Core/Configuration/SettingChangedEventArgs.cs
+++ b/BepInEx.Core/Configuration/SettingChangedEventArgs.cs
@@ -3,7 +3,7 @@
namespace BepInEx.Configuration;
///
-/// Arguments for events concerning a change of a setting.
+/// Arguments for events concerning a change of a setting.
///
///
public sealed class SettingChangedEventArgs : EventArgs
@@ -15,7 +15,7 @@ public SettingChangedEventArgs(ConfigEntryBase changedSetting)
}
///
- /// Setting that was changed
+ /// Setting that was changed
///
public ConfigEntryBase ChangedSetting { get; }
}
diff --git a/BepInEx.Core/Configuration/TomlTypeConverter.cs b/BepInEx.Core/Configuration/TomlTypeConverter.cs
index a1b2348d8..43af873f1 100644
--- a/BepInEx.Core/Configuration/TomlTypeConverter.cs
+++ b/BepInEx.Core/Configuration/TomlTypeConverter.cs
@@ -8,7 +8,7 @@
namespace BepInEx.Configuration;
///
-/// Serializer/deserializer used by the config system.
+/// Serializer/deserializer used by the config system.
///
public static class TomlTypeConverter
{
@@ -103,7 +103,7 @@ public static class TomlTypeConverter
};
///
- /// Convert object of a given type to a string using available converters.
+ /// Convert object of a given type to a string using available converters.
///
public static string ConvertToString(object value, Type valueType)
{
@@ -115,12 +115,12 @@ public static string ConvertToString(object value, Type valueType)
}
///
- /// Convert string to an object of a given type using available converters.
+ /// Convert string to an object of a given type using available converters.
///
public static T ConvertToValue(string value) => (T) ConvertToValue(value, typeof(T));
///
- /// Convert string to an object of a given type using available converters.
+ /// Convert string to an object of a given type using available converters.
///
public static object ConvertToValue(string value, Type valueType)
{
@@ -132,7 +132,7 @@ public static object ConvertToValue(string value, Type valueType)
}
///
- /// Get a converter for a given type if there is any.
+ /// Get a converter for a given type if there is any.
///
public static TypeConverter GetConverter(Type valueType)
{
@@ -148,8 +148,8 @@ public static TypeConverter GetConverter(Type valueType)
}
///
- /// Add a new type converter for a given type.
- /// If a different converter is already added, this call is ignored and false is returned.
+ /// Add a new type converter for a given type.
+ /// If a different converter is already added, this call is ignored and false is returned.
///
public static bool AddConverter(Type type, TypeConverter converter)
{
@@ -167,12 +167,12 @@ public static bool AddConverter(Type type, TypeConverter converter)
}
///
- /// Check if a given type can be converted to and from string.
+ /// Check if a given type can be converted to and from string.
///
public static bool CanConvert(Type type) => GetConverter(type) != null;
///
- /// Give a list of types with registered converters.
+ /// Give a list of types with registered converters.
///
public static IEnumerable GetSupportedTypes() => TypeConverters.Keys;
diff --git a/BepInEx.Core/Configuration/TypeConverter.cs b/BepInEx.Core/Configuration/TypeConverter.cs
index 71a92c84a..e6b12475e 100644
--- a/BepInEx.Core/Configuration/TypeConverter.cs
+++ b/BepInEx.Core/Configuration/TypeConverter.cs
@@ -3,19 +3,19 @@
namespace BepInEx.Configuration;
///
-/// A serializer/deserializer combo for some type(s). Used by the config system.
+/// A serializer/deserializer combo for some type(s). Used by the config system.
///
public class TypeConverter
{
///
- /// Used to serialize the type into a (hopefully) human-readable string.
- /// Object is the instance to serialize, Type is the object's type.
+ /// Used to serialize the type into a (hopefully) human-readable string.
+ /// Object is the instance to serialize, Type is the object's type.
///
public Func