private void startPlugin(Plugin plugin) { //OSAEObject obj = OSAEObjectManager.GetObjectByName(plugin.PluginName); //OSAEObjectManager.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Alias, obj.Description, obj.Type, obj.Address, obj.Container, obj.MinTrustLevel, true); try { if (plugin.ActivatePlugin()) { plugin.RunInterface(serviceObject); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", serviceObject); Log.Info("Plugin started: " + plugin.PluginName); } } catch (Exception ex) { Log.Error("Error starting plugin (" + plugin.PluginName + ")", ex); plugin.Running = false; } }
private void enablePlugin(Plugin plugin) { OSAEObject obj = OSAEObjectManager.GetObjectByName(plugin.PluginName); OSAEObjectManager.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Alias, obj.Description, obj.Type, obj.Address, obj.Container, 1); try { if (plugin.ActivatePlugin()) { plugin.RunInterface(); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", sourceName); this.Log.Info("Plugin enabled: " + plugin.PluginName); } } catch (Exception ex) { this.Log.Error("Error activating plugin (" + plugin.PluginName + ")", ex); } }