public IEnumerator <PluginInfo> GetEnumerator() { int count = PluginAPI.CountPlugins(); for (int index = 0; index < count; index++) { yield return(new PluginInfo(PluginAPI.GetNthPlugin(index))); } }
public PluginInfo this[int index] { get { if (index < 0 || index >= Count) { throw new ArgumentOutOfRangeException(nameof(index)); } return(new PluginInfo(PluginAPI.GetNthPlugin(index))); } }
public static unsafe IReadOnlyCollection <string> GetFeatures() { var features = new HashSet <string>(); var handle = GCHandle.Alloc(features); try { PluginAPI.EnumerateFeatures(Callback, GCHandle.ToIntPtr(handle).ToPointer()); return(features); } finally { handle.Free(); }
public void Setup(Config cfg) { localConfig = cfg; PluginAPI.WriteLine("Configuration file loaded."); }
public static void EnableFeature(string feature, bool enable = true) => PluginAPI.EnableFeature(feature, enable.ToInt());
public static bool IsFeatureEnabled(string feature) => PluginAPI.IsFeatureEnabled(feature) != 0;
public static bool HasFeature(string feature) => PluginAPI.HasFeature(feature) != 0;