private void OnPluginUnloaded(PointBlankPlugin plugin) { foreach (Type _class in plugin.GetType().Assembly.GetTypes()) { SaveInterface(_class); } }
private void OnPluginUnloaded(PointBlankPlugin plugin) { foreach (KeyValuePair <DetourAttribute, DetourWrapper> kvp in Detours.Where(a => a.Key.Method.DeclaringType.Assembly == plugin.GetType().Assembly&& !a.Value.Local)) { kvp.Value.Revert(); Detours.Remove(kvp.Key); } }
private void OnPluginUnloaded(PointBlankPlugin plugin) { foreach (CommandWrapper wrap in Commands.Where(a => a.Class.DeclaringType.Assembly == plugin.GetType().Assembly)) { Commands.Remove(wrap); } UniConfig.Save(); }
private void OnPluginLoaded(PointBlankPlugin plugin) { foreach (Type tClass in plugin.GetType().Assembly.GetTypes()) { if (tClass.IsClass) { LoadCommand(tClass); } } }
private void OnPluginUnloaded(PointBlankPlugin plugin) { PluginWrapper wrapper = PM.Plugins.First(a => a.PluginClass == plugin); foreach (KeyValuePair <DetourAttribute, DetourWrapper> kvp in Detours.Where(a => a.Key.Method.DeclaringType.Assembly == wrapper.PluginAssembly && !a.Value.Local)) { kvp.Value.Revert(); Detours.Remove(kvp.Key); } }
private void OnPluginUnloaded(PointBlankPlugin plugin) { PluginWrapper wrapper = PluginManager.PluginManager.Plugins.First(a => a.PluginClass == plugin); foreach (CommandWrapper wrap in Commands.Where(a => a.Class.DeclaringType.Assembly == wrapper.PluginAssembly)) { Commands.Remove(wrap); } UniConfig.Save(); }
private void OnPluginLoaded(PointBlankPlugin plugin) { foreach (Type class_type in plugin.GetType().Assembly.GetTypes()) { LoadService(class_type); } foreach (PointBlankService ser in _tempServices.OrderBy(a => a.LaunchIndex)) { RunService(ser); } _tempServices.Clear(); }
private void OnPluginLoaded(PointBlankPlugin plugin) { PluginWrapper wrapper = PluginManager.PluginManager.Plugins.First(a => a.PluginClass == plugin); foreach (Type tClass in wrapper.PluginAssembly.GetTypes()) { if (tClass.IsClass) { LoadCommand(tClass); } } }
private void OnPluginLoaded(PointBlankPlugin plugin) { foreach (Type tClass in plugin.GetType().Assembly.GetTypes()) { if (tClass.IsClass) { foreach (MethodInfo method in tClass.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)) { LoadDetour(method); } } } }
private void OnPluginLoaded(PointBlankPlugin plugin) { PluginWrapper wrapper = PM.Plugins.First(a => a.PluginClass == plugin); foreach (Type tClass in wrapper.PluginAssembly.GetTypes()) { if (tClass.IsClass) { foreach (MethodInfo method in tClass.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)) { LoadDetour(method); } } } }
/// <summary> /// Easy to use configuration value extractor /// </summary> /// <typeparam name="T">The configuration value type</typeparam> /// <param name="key">The key of the configuration value</param> /// <returns>The configuration value with specified type</returns> public T Configure <T>(string key) => PointBlankPlugin.GetInstance(this).Configure <T>(key);
/// <summary> /// Translates a key and data to text depending on the translation /// </summary> /// <param name="key">The key of the translation</param> /// <param name="data">The data to modify the translation</param> /// <returns>The translated text</returns> public string Translate(string key, params object[] data) => PointBlankPlugin.GetInstance(this).Translate(key, data);
public PluginWrapper GetWrapper(PointBlankPlugin plugin) => Plugins.First(a => a.PluginClass == plugin);