Exemple #1
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            var meta = pluginRuntime.Metadata;

            Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

            DvDevice device = ServiceRegistration.Get <IBackendServer>().UPnPBackendServer.FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();

            if (device != null)
            {
                var serverSettings = new ServerSettingsImpl();
                Logger.Debug("ServerSettings: Registering ServerSettings service.");
                device.AddService(serverSettings);
                Logger.Debug("ServerSettings: Adding ServerSettings service to MP2 backend root device");

                // List all assemblies
                InitPluginAssemblyList();

                // Set our own resolver to lookup types from any of assemblies from Plugins subfolder.
                SettingsSerializer.CustomAssemblyResolver = PluginsAssemblyResolver;
                // AppDomain.CurrentDomain.AssemblyResolve += PluginsAssemblyResolver;

                Logger.Debug("ServerSettings: Adding Plugins folder to private path");
            }
            else
            {
                Logger.Error("ServerSettings: MP2 backend root device not found!");
            }
        }
    public void Activated(PluginRuntime pluginRuntime)
    {
      var meta = pluginRuntime.Metadata;
      Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

      DvDevice device = ServiceRegistration.Get<IBackendServer>().UPnPBackendServer.FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();
      if (device != null)
      {
        var serverSettings = new ServerSettingsImpl();
        Logger.Debug("ServerSettings: Registering ServerSettings service.");
        device.AddService(serverSettings);
        Logger.Debug("ServerSettings: Adding ServerSettings service to MP2 backend root device");

        // List all assemblies
        InitPluginAssemblyList();

        // Set our own resolver to lookup types from any of assemblies from Plugins subfolder.
        SettingsSerializer.CustomAssemblyResolver = PluginsAssemblyResolver;
        // AppDomain.CurrentDomain.AssemblyResolve += PluginsAssemblyResolver;

        Logger.Debug("ServerSettings: Adding Plugins folder to private path");
      }
      else
      {
        Logger.Error("ServerSettings: MP2 backend root device not found!");
      }
    }