/// <summary> /// Registers a delegate for creating an additional UPnP service proxy object upon device connection. This control point keeps track of the /// connection state, i.e. calls the given <paramref name="additionalServiceCreatorDlgt"/> delegate when the device is connected and disposes the /// service proxy object when the device is disconnected. /// </summary> /// <remarks> /// This method will typically be used by plugins which want to register custom UPnP service proxy objects. The service proxy object, which is created /// by the caller of this method, will typically be made available for usage in the given <paramref name="additionalServiceCreatorDlgt"/> method and /// revoked by the <see cref="IDisposable.Dispose"/> method of the custom service proxy object. /// </remarks> /// <param name="additionalServiceCreatorDlgt">Delegate which is able to create a service proxy object.</param> public void RegisterAdditionalService(AdditionalServiceRegisterDlgt additionalServiceCreatorDlgt) { lock (_networkTracker.SharedControlPointData.SyncObj) _additionalServiceRegistrations.Add(additionalServiceCreatorDlgt); }
/// <summary> /// Registers a delegate for creating an additional UPnP service proxy object upon device connection. This control point keeps track of the /// connection state, i.e. calls the given <paramref name="additionalServiceCreatorDlgt"/> delegate when the device is connected and disposes the /// service proxy object when the device is disconnected. /// </summary> /// <remarks> /// This method will typically be used by plugins which want to register custom UPnP service proxy objects. The service proxy object, which is created /// by the caller of this method, will typically be made available for usage in the given <paramref name="additionalServiceCreatorDlgt"/> method and /// revoked by the <see cref="IDisposable.Dispose"/> method of the custom service proxy object. /// </remarks> /// <param name="additionalServiceCreatorDlgt">Delegate which is able to create a service proxy object.</param> public void RegisterAdditionalService(AdditionalServiceRegisterDlgt additionalServiceCreatorDlgt) { using (_networkTracker.SharedControlPointData.Lock.EnterWrite()) _additionalServiceRegistrations.Add(additionalServiceCreatorDlgt); }