Exemple #1
0
        public DirectoryServer()
        {
            device = UPnPDevice.CreateRootDevice(1800, 1.0, "\\");

            device.FriendlyName     = "Local Audio Broadcast @ " + System.Environment.MachineName;
            device.Manufacturer     = "Mario Guggenberger / Protyposis";
            device.ManufacturerURL  = "http://protyposis.net";
            device.ModelName        = "LAB";
            device.ModelDescription = "LAB";
            device.ModelNumber      = "1.0";
            device.HasPresentation  = false;
            device.DeviceURN        = "urn:schemas-upnp-org:device:MediaServer:1";


            DvX_MS_MediaReceiverRegistrar X_MS_MediaReceiverRegistrar = new DvX_MS_MediaReceiverRegistrar();

            X_MS_MediaReceiverRegistrar.External_IsAuthorized   = new DvX_MS_MediaReceiverRegistrar.Delegate_IsAuthorized(X_MS_MediaReceiverRegistrar_IsAuthorized);
            X_MS_MediaReceiverRegistrar.External_IsValidated    = new DvX_MS_MediaReceiverRegistrar.Delegate_IsValidated(X_MS_MediaReceiverRegistrar_IsValidated);
            X_MS_MediaReceiverRegistrar.External_RegisterDevice = new DvX_MS_MediaReceiverRegistrar.Delegate_RegisterDevice(X_MS_MediaReceiverRegistrar_RegisterDevice);
            device.AddService(X_MS_MediaReceiverRegistrar);
            DvConnectionManager ConnectionManager = new DvConnectionManager();

            ConnectionManager.External_GetCurrentConnectionIDs  = new DvConnectionManager.Delegate_GetCurrentConnectionIDs(ConnectionManager_GetCurrentConnectionIDs);
            ConnectionManager.External_GetCurrentConnectionInfo = new DvConnectionManager.Delegate_GetCurrentConnectionInfo(ConnectionManager_GetCurrentConnectionInfo);
            ConnectionManager.External_GetProtocolInfo          = new DvConnectionManager.Delegate_GetProtocolInfo(ConnectionManager_GetProtocolInfo);
            device.AddService(ConnectionManager);
            DvContentDirectory ContentDirectory = new DvContentDirectory();

            ContentDirectory.External_Browse = new DvContentDirectory.Delegate_Browse(ContentDirectory_Browse);
            ContentDirectory.External_GetSearchCapabilities = new DvContentDirectory.Delegate_GetSearchCapabilities(ContentDirectory_GetSearchCapabilities);
            ContentDirectory.External_GetSortCapabilities   = new DvContentDirectory.Delegate_GetSortCapabilities(ContentDirectory_GetSortCapabilities);
            ContentDirectory.External_GetSystemUpdateID     = new DvContentDirectory.Delegate_GetSystemUpdateID(ContentDirectory_GetSystemUpdateID);
            ContentDirectory.External_Search = new DvContentDirectory.Delegate_Search(ContentDirectory_Search);
            device.AddService(ContentDirectory);

            // Setting the initial value of evented variables
            X_MS_MediaReceiverRegistrar.Evented_AuthorizationGrantedUpdateID = 0;
            X_MS_MediaReceiverRegistrar.Evented_ValidationRevokedUpdateID    = 0;
            X_MS_MediaReceiverRegistrar.Evented_ValidationSucceededUpdateID  = 0;
            X_MS_MediaReceiverRegistrar.Evented_AuthorizationDeniedUpdateID  = 0;
            ConnectionManager.Evented_SourceProtocolInfo   = "Sample String";
            ConnectionManager.Evented_SinkProtocolInfo     = "Sample String";
            ConnectionManager.Evented_CurrentConnectionIDs = "Sample String";
            ContentDirectory.Evented_ContainerUpdateIDs    = "Sample String";
            ContentDirectory.Evented_SystemUpdateID        = 0;
        }
Exemple #2
0
 internal _DvX_MS_MediaReceiverRegistrar(DvX_MS_MediaReceiverRegistrar n)
 {
     Outer = n;
     S     = BuildUPnPService();
 }