/*
Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved.
*/
using Il2CppInspector.PluginAPI.V100;
namespace Il2CppInspector.PluginAPI
{
///
/// Plugin-related services we provide to plugins that they can call upon
///
public class PluginServices
{
// The plugin we are providing services to
private IPlugin plugin;
private PluginServices(IPlugin plugin) => this.plugin = plugin;
///
/// Get plugin services for a specific plugin
/// Designed to be used by plugins as a service factory
///
/// The plugin to provide services to
/// A PluginServices object
public static PluginServices For(IPlugin plugin) {
return new PluginServices(plugin);
}
///
/// Provide visual status update text for long-running operations
///
/// The text to report
public void StatusUpdate(string text) => PluginManager.StatusUpdate(plugin, text);
///
/// An overload of StatusUpdate that can be cast to EventHandler
///
public void StatusUpdate(object sender, string text) => StatusUpdate(text);
}
}