Ejemplo n.º 1
0
        public MediaServer(string udn, string friendlyName, string manufacturer, string modelName, DeviceOptions options, ConnectionManager connectionManager, LocalContentDirectory contentDirectory)
        {
            if (connectionManager == null)
            {
                throw new ArgumentNullException("connnectionManager");
            }
            if (contentDirectory == null)
            {
                throw new ArgumentNullException("contentDirectory");
            }

            if (options == null)
            {
                options = new DeviceOptions();
            }

            this.content_directory = contentDirectory;

            var connectionManagerService = new Service <ConnectionManager> (ConnectionManager.ServiceType, "urn:upnp-org:serviceId:ConnectionManager", connectionManager);
            var contentDirectoryService  = new Service <LocalContentDirectory> (ContentDirectory.ServiceType, "urn:upnp-org:serviceId:ContentDirectory", contentDirectory);

            options.Services = Combine(new Service[] { connectionManagerService, contentDirectoryService }, options.Services);
            server           = new Server(new Root(DeviceType, udn, friendlyName, manufacturer, modelName, options));
        }
Ejemplo n.º 2
0
 public MediaServer(string udn, string friendlyName, string manufacturer, string modelName, ConnectionManager connectionManager, LocalContentDirectory contentDirectory)
     : this(udn, friendlyName, manufacturer, modelName, null, connectionManager, contentDirectory)
 {
 }