API Reference › Extensions
IExtensionService
InterfaceNamespace: SwiftlyS2.Shared.Extensions · Assembly: SwiftlyS2.CS2.dll
public interface IExtensionServiceManages native extensions and their shared pointer registry.
View sourceMethods
Gets a shared pointer, or zero if the key does not exist. Use HasSharedPointer to distinguish a stored zero from a missing key.
nint GetSharedPointer(string key)Parameters
- keystring
Returns
Checks whether a shared pointer key exists, including keys with zero values.
bool HasSharedPointer(string key)Parameters
- keystring
Returns
Loads an extension from an absolute path to its library. The extension ID is the library filename without its extension.
bool LoadFromPath(string absolutePath)Parameters
- absolutePathstring
Exceptions
- ArgumentExceptionThe path is empty or not fully qualified.
Removes a shared pointer key without freeing the pointed-to object. Missing keys are ignored.
void RemoveSharedPointer(string key)Parameters
- keystring
Inserts or replaces a shared pointer. The value can be zero. The registry does not own the pointed-to object or free replaced values.
void SetSharedPointer(string key, nint pointer)Unloads an extension and invokes its registered unload callback.
bool Unload(string id)Parameters
- idstring
Unloads an extension by the absolute path to its library.
bool UnloadFromPath(string absolutePath)Parameters
- absolutePathstring
Exceptions
- ArgumentExceptionThe path is empty or not fully qualified.