//private string serviceName; public void startPlugin(string serviceName, Plugin plugin) { Log = new General.OSAELog(serviceName); Log.Info(plugin.PluginName + ": Starting Plugin..."); OSAEObject obj = OSAEObjectManager.GetObjectByName(plugin.PluginName); //Enabe and start seemed to be mixed, changed to start, enabe is handled at the Webui for now, maybe a method in the future //OSAEObjectManager.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Alias, obj.Description, obj.Type, obj.Address, obj.Container, obj.MinTrustLevel, true); try { if (plugin.ActivatePlugin()) { // plugin.Enabled = true; plugin.RunInterface(serviceObject); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", "SYSTEM"); Log.Debug(plugin.PluginName + ": Plugin started."); } } catch (Exception ex) { Log.Error("Error activating plugin (" + plugin.PluginName + "): " + ex.Message, ex); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "OFF", "SYSTEM"); } }
public void enablePlugin(Plugin plugin) { OSAEObject obj = OSAEObjectManager.GetObjectByName(plugin.PluginName); OSAEObjectManager.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Description, obj.Type, obj.Address, obj.Container, 1); try { if (plugin.ActivatePlugin()) { plugin.Enabled = true; plugin.RunInterface(); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", sourceName); logging.AddToLog("Plugin enabled: " + plugin.PluginName, true); } } catch (Exception ex) { logging.AddToLog("Error activating plugin (" + plugin.PluginName + "): " + ex.Message + " - " + ex.InnerException, true); } }
public void enablePlugin(Plugin plugin) { OSAEObject obj = OSAEObjectManager.GetObjectByName(plugin.PluginName); OSAEObjectManager.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Description, obj.Type, obj.Address, obj.Container, 1); try { if (plugin.ActivatePlugin()) { plugin.Enabled = true; plugin.RunInterface(); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", sourceName); sendMessageToClients(WCF.OSAEWCFMessageType.PLUGIN, plugin.PluginName + " | " + plugin.Enabled.ToString() + " | " + plugin.PluginVersion + " | Running | " + plugin.LatestAvailableVersion + " | " + plugin.PluginType + " | " + Common.ComputerName); logging.AddToLog("Plugin enabled: " + plugin.PluginName, true); } } catch (Exception ex) { logging.AddToLog("Error activating plugin (" + plugin.PluginName + "): " + ex.Message + " - " + ex.InnerException, true); } }
public void enablePlugin(Plugin plugin) { this.Log.Info(plugin.PluginName + ": Enabling 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.Enabled = true; plugin.RunInterface(); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", sourceName); this.Log.Debug(plugin.PluginName + ": Plugin enabled."); } } catch (Exception ex) { this.Log.Error("Error activating plugin (" + plugin.PluginName + "): " + ex.Message, ex); } }
//private string serviceName; public void startPlugin(string serviceName,Plugin plugin) { Log = new General.OSAELog(serviceName); Log.Info(plugin.PluginName + ": Starting Plugin..."); OSAEObject obj = OSAEObjectManager.GetObjectByName(plugin.PluginName); //Enabe and start seemed to be mixed, changed to start, enabe is handled at the Webui for now, maybe a method in the future //OSAEObjectManager.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Alias, obj.Description, obj.Type, obj.Address, obj.Container, obj.MinTrustLevel, true); try { if (plugin.ActivatePlugin()) { // plugin.Enabled = true; plugin.RunInterface(serviceObject); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "ON", "SYSTEM"); Log.Debug(plugin.PluginName + ": Plugin started."); } } catch (Exception ex) { Log.Error("Error activating plugin (" + plugin.PluginName + "): " + ex.Message, ex); OSAEObjectStateManager.ObjectStateSet(plugin.PluginName, "OFF", "SYSTEM"); } }
public void enablePlugin(Plugin plugin) { OSAEObject obj = osae.GetObjectByName(plugin.PluginName); osae.ObjectUpdate(plugin.PluginName, plugin.PluginName, obj.Description, obj.Type, obj.Address, obj.Container, 1); try { if (plugin.ActivatePlugin()) { plugin.Enabled = true; plugin.RunInterface(); osae.ObjectStateSet(plugin.PluginName, "ON"); sendMessageToClients("plugin", plugin.PluginName + " | " + plugin.Enabled.ToString() + " | " + plugin.PluginVersion + " | Running | " + plugin.LatestAvailableVersion + " | " + plugin.PluginType + " | " + osae.ComputerName); osae.AddToLog("Plugin enabled: " + plugin.PluginName, true); } } catch (Exception ex) { osae.AddToLog("Error activating plugin (" + plugin.PluginName + "): " + ex.Message + " - " + ex.InnerException, true); } catch { osae.AddToLog("Error activating plugin", true); } }