private void RegisterForChangeNotifications() { if (DiagnosticsAggregationServicelet.serverConfigNotificationCookie != null) { throw new InvalidOperationException("Cannot register for transportserver AD change notifications twice"); } ADNotificationAdapter.TryRegisterChangeNotification <Server>(DiagnosticsAggregationServicelet.localServer.Id, new ADNotificationCallback(DiagnosticsAggregationServicelet.OnLocalServerChanged), 5, out DiagnosticsAggregationServicelet.serverConfigNotificationCookie); if (DiagnosticsAggregationServicelet.transportSettingsNotificationCookie != null) { throw new InvalidOperationException("Cannot register for transportsettings AD change notifications twice"); } ADNotificationAdapter.TryRegisterChangeNotification <TransportConfigContainer>(DiagnosticsAggregationServicelet.TransportSettings.Id, new ADNotificationCallback(this.OnTransportSettingsChanged), 5, out DiagnosticsAggregationServicelet.transportSettingsNotificationCookie); }