private void stopPlugin(Plugin p)
        {
            //OSAEObject obj = OSAEObjectManager.GetObjectByName(p.PluginName);
            //OSAEObjectManager.ObjectUpdate(p.PluginName, p.PluginName, obj.Alias, obj.Description, obj.Type, obj.Address, obj.Container, obj.MinTrustLevel, false);
            try
            {
                p.Shutdown();
                p.Running = false;
               // p.Enabled = false;
                p.Domain = Common.CreateSandboxDomain("Sandbox Domain", p.Location, SecurityZone.Internet, typeof(ClientService));
                OSAEObjectStateManager.ObjectStateSet(p.PluginName, "OFF", serviceObject);

            }
            catch (Exception ex)
            { Log.Error("Error stopping plugin (" + p.PluginName + ")", ex); }
        }
        private void disablePlugin(Plugin p)
        {
            OSAEObject obj = OSAEObjectManager.GetObjectByName(p.PluginName);

            OSAEObjectManager.ObjectUpdate(p.PluginName, p.PluginName, obj.Alias, obj.Description, obj.Type, obj.Address, obj.Container, 0);
            try
            {
                p.Shutdown();
                p.Enabled = false;
                p.Domain = Common.CreateSandboxDomain("Sandbox Domain", p.Location, SecurityZone.Internet, typeof(ClientService));

            }
            catch (Exception ex)
            {
                this.Log.Error("Error stopping plugin (" + p.PluginName + ")", ex);
            }
        }
 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);
            }
        }