void PrimitiveCommandHandler(object sender, GenericEventArgs<string> e) { if (current.Triangle != null) { InvokePrimitive(e.Argument); } }
// Invoke the Changed event; called whenever list changes protected virtual void OnFileUploadComplete(GenericEventArgs<string> e) { if (FileUploadComplete != null) { FileUploadComplete(this,e); } }
void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs<UpnpDeviceInfo> e) { string server = null; var info = e.Argument; if (info.Headers.TryGetValue("SERVER", out server) && server.IndexOf("HDHomeRun", StringComparison.OrdinalIgnoreCase) != -1) { string location; if (info.Headers.TryGetValue("Location", out location)) { //_logger.Debug("HdHomerun found at {0}", location); // Just get the beginning of the url Uri uri; if (Uri.TryCreate(location, UriKind.Absolute, out uri)) { var apiUrl = location.Replace(uri.LocalPath, String.Empty, StringComparison.OrdinalIgnoreCase) .TrimEnd('/'); //_logger.Debug("HdHomerun api url: {0}", apiUrl); AddDevice(apiUrl); } } } }
async void _taskManager_TaskCompleted(object sender, GenericEventArgs<TaskResult> e) { var result = e.Argument; if (result.Status == TaskCompletionStatus.Failed) { foreach (var user in _userManager .Users .Where(i => i.Configuration.IsAdministrator) .ToList()) { var notification = new Notification { UserId = user.Id, Category = "ScheduledTaskFailed", Name = result.Name + " failed", RelatedId = result.Name, Description = result.ErrorMessage, Level = NotificationLevel.Error }; try { await _notificationsRepo.AddNotification(notification, CancellationToken.None).ConfigureAwait(false); } catch (Exception ex) { _logger.ErrorException("Error adding notification", ex); } } } }
void fabric_AddRobotAction(object sender, GenericEventArgs<Robot> e) { RobotButton robotButton = robotPanel.AddRobot(e.Value).GetComponent<RobotButton>(); _robotButtons.Add(robotButton); robotButton.ClickAction += robotButton_ClickAction; e.Value.ReturnAction += robots_ReturnAction; }
void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs<UpnpDeviceInfo> e) { var info = e.Argument; string st = null; string nt = null; info.Headers.TryGetValue("ST", out st); info.Headers.TryGetValue("NT", out nt); if (string.Equals(st, "urn:ses-com:device:SatIPServer:1", StringComparison.OrdinalIgnoreCase) || string.Equals(nt, "urn:ses-com:device:SatIPServer:1", StringComparison.OrdinalIgnoreCase)) { string location; if (info.Headers.TryGetValue("Location", out location) && !string.IsNullOrWhiteSpace(location)) { _logger.Debug("SAT IP found at {0}", location); // Just get the beginning of the url Uri uri; if (Uri.TryCreate(location, UriKind.Absolute, out uri)) { var apiUrl = location.Replace(uri.LocalPath, String.Empty, StringComparison.OrdinalIgnoreCase) .TrimEnd('/'); AddDevice(apiUrl, location); } } } }
void Demon_OnCollisionWithPlayer(object sender, GenericEventArgs<ArcanaPlayer> e) { if (attackCounter > attackRate) { e.Data.Damage(DemonDamage); attackCounter = TimeSpan.Zero; } }
void AngryRock_OnCollisionWithPlayer(object sender, GenericEventArgs<ArcanaPlayer> e) { if (currentTime >= RockAttackSpeed) { currentTime = TimeSpan.Zero; e.Data.Damage(RockRamage); } }
private void ConnectionManagerOnConnected(object sender, GenericEventArgs<ConnectionResult> e) { var apiClient = e.Argument.ApiClient; if (apiClient != null) { apiClient.UserUpdated -= ApiClientOnUserUpdated; apiClient.UserUpdated += ApiClientOnUserUpdated; } }
void _taskManager_TaskCompleted(object sender, GenericEventArgs<TaskResult> e) { if (Plugin.Instance.Configuration.Notifications.Tasks) { if (e.Argument.Status.ToString() == "Failed") { _pusher.Push("Media Server Task " + e.Argument.Name + " Error : " + e.Argument.ErrorMessage, 0); } } }
async void PlayAudio(object sender, GenericEventArgs<Stream> args) { await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { Stream str = args.EventData; InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream(); await str.CopyToAsync(ras.AsStreamForWrite()); Windows.Media.Playback.BackgroundMediaPlayer.Current.SetStreamSource(ras); }); }
void _config_ConfigurationUpdating(object sender, GenericEventArgs<ServerConfiguration> e) { var options = e.Argument.SubtitleOptions; if (options != null && !string.IsNullOrWhiteSpace(options.OpenSubtitlesPasswordHash) && !options.OpenSubtitlesPasswordHash.StartsWith(PasswordHashPrefix, StringComparison.OrdinalIgnoreCase)) { options.OpenSubtitlesPasswordHash = EncryptPassword(options.OpenSubtitlesPasswordHash); } }
private void ConnectionManagerOnLocalUserSignIn(object sender, GenericEventArgs<UserDto> e) { Deployment.Current.Dispatcher.BeginInvoke(() => { LoggedInUser = e.Argument; if (AuthenticationResult != null && _connectionManager.CurrentApiClient != null) { _connectionManager.CurrentApiClient.SetAuthenticationInfo(AuthenticationResult.AccessToken, LoggedInUserId); } }); }
void commandHandler_StartMoveAction(object sender, GenericEventArgs<Robot> e) { foreach (Platform platform in _platforms) platform.DarkenPlatform(); foreach (RobotButton button in _robotButtons) { if (button.FixedRobot == e.Value) button.Deactivate(); } }
private void ApiClientOnUserUpdated(object sender, GenericEventArgs<UserDto> e) { Deployment.Current.Dispatcher.BeginInvoke(() => { SetUser(e.Argument); var apiClient = sender as IApiClient; if (apiClient != null) { SetAccessToken(apiClient.AccessToken); } }); }
async void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e) { var type = NotificationType.UserLockedOut.ToString(); var notification = new NotificationRequest { NotificationType = type }; notification.Variables["UserName"] = e.Argument.Name; await SendNotification(notification).ConfigureAwait(false); }
async void _appHost_ApplicationUpdated(object sender, GenericEventArgs<PackageVersionInfo> e) { var type = NotificationType.ApplicationUpdateInstalled.ToString(); var notification = new NotificationRequest { NotificationType = type }; notification.Variables["Version"] = e.Argument.versionStr; notification.Variables["ReleaseNotes"] = e.Argument.description; await SendNotification(notification).ConfigureAwait(false); }
/// <summary> /// Event handler for when a client connects. /// Makes sure there is enough room on the server before allowing it to proceed. /// if successful it starts the client read/write threads. /// </summary> /// <param name="sender">Client that is connecting</param> /// <param name="e">the handshake (contains its name)</param> public void Client_Connected(Client sender, GenericEventArgs<String> e) { if (!Interlocked.Equals(this.connectedClients, this.maxClients)) { Interlocked.Increment(ref this.connectedClients); this.On_Client_Sending += sender.Client_Sending; //subscribe to the send to all event sender.StartUp(); Console.WriteLine("Client connected: {0}", sender.Name); } else { sender.Close_Connection(); Console.WriteLine("Client refused, server full: {0}", sender.Name); } }
void _serverEvents_UserDataChanged(object sender, GenericEventArgs<UserDataChangeInfo> e) { var key = _item.UserData == null ? string.Empty : _item.UserData.Key; if (!string.IsNullOrEmpty(key)) { var data = e.Argument.UserDataList.FirstOrDefault(i => string.Equals(key, i.Key, StringComparison.OrdinalIgnoreCase)); if (data != null) { _item.UserData = data; RefreshUserDataFields(); } } }
private async void _syncManager_SyncJobItemUpdated(object sender, GenericEventArgs<SyncJobItem> e) { var item = e.Argument; if (item.Status == SyncJobItemStatus.ReadyToTransfer) { try { await _sessionManager.SendMessageToUserDeviceSessions(item.TargetId, "SyncJobItemReady", item, CancellationToken.None).ConfigureAwait(false); } catch { } } }
private void TweetReceived(GenericEventArgs<ITweet> tweetEvent) { if (!tweetEvent.Value.Text.Contains(ConfigurationManager.AppSettings["AccountName"])) return; var tweet = tweetEvent.Value; var scoreInfo = new ScoreInfo { Id = tweet.Id, TextScore = StripMentions(tweet.Text), Username = tweet.Creator.ScreenName, DateTime = tweet.CreatedAt, }; if (Received != null) Received(scoreInfo); }
private void OnLanguageSwitcherInitailized(object sender, GenericEventArgs<Collection<ResourceDictionary>> e) { // Handling the custom language file for the main application. // Not all the switchers need this step. if (SwitchLanguageMessage.CustomLanguageKey.Equals(Settings.Default.CurrentLanguage, StringComparison.Ordinal)) { if (File.Exists(Settings.Default.CustomLanguageFile)) { e.Data.Add(Settings.Default.CustomLanguageFile.MakeResource()); } // 自定义语言文件不存在,则使用当前语言 else { Settings.Default.CurrentLanguage = Thread.CurrentThread.CurrentUICulture.Name; e.Data.Add(switcher.ResourceFormat.MakeResource(Settings.Default.CurrentLanguage)); } } }
async void _userManager_UserCreated(object sender, GenericEventArgs<User> e) { var notification = new Notification { UserId = e.Argument.Id, Category = "UserCreated", Name = "Welcome to Media Browser!", Description = "Check back here for more notifications." }; try { await _notificationsRepo.AddNotification(notification, CancellationToken.None).ConfigureAwait(false); } catch (Exception ex) { _logger.ErrorException("Error adding notification", ex); } }
void HandlerLoadBookRequestCompleted(object sender, GenericEventArgs<HttpWebResponse> e) { if (e.Value.StatusCode != HttpStatusCode.OK) { throw new Exception(String.Format("Server error (HTTP {0}: {1}).", e.Value.StatusCode, e.Value.StatusDescription)); } else { this.Dispatcher.Invoke((Action)(() => { if (e.Value.StatusCode != HttpStatusCode.OK) { throw new Exception(String.Format( "Server error (HTTP {0}: {1}).", e.Value.StatusCode, e.Value.StatusDescription)); } var reader = new StreamReader(e.Value.GetResponseStream()); System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); var obj = js.Deserialize<dynamic>(reader.ReadToEnd()); foreach (var o in obj) { var id = o["id"]; var name = o["name"]; var description = o["description"]; var picture = o["picture"]; var author = o["author"]; var status = o["status"]; var date = o["published_date"]; var pageCount = o["page_count"]; listBook.Add(new Book(id, picture, name, description, author, status, date, pageCount)); } mainWindow = (MainWindow)Window.GetWindow(this); mainWindow.ProgressBar.Visibility = Visibility.Collapsed; this.Visibility = Visibility.Visible; })); } }
void connection_ConnectionStateChanged(object sender, GenericEventArgs<ConnectionState> e) { switch (e.Item) { case ConnectionState.Success: lblStatus.Text = "Online"; if (ConnectedSuccessfully!= null) { ConnectedSuccessfully(this, new GenericEventArgs<MediaConnection>(connection)); } this.DialogResult = true; break; case ConnectionState.Failed: lblStatus.Text = "Connection failed"; break; case ConnectionState.Closed: lblStatus.Text = "Closed"; break; } }
async void _serverManager_WebSocketConnected(object sender, GenericEventArgs<IWebSocketConnection> e) { var session = await GetSession(e.Argument.QueryString, e.Argument.RemoteEndPoint).ConfigureAwait(false); if (session != null) { var controller = session.SessionController as WebSocketController; if (controller == null) { controller = new WebSocketController(session, _logger, _sessionManager); } controller.AddWebSocket(e.Argument); session.SessionController = controller; } else { _logger.Warn("Unable to determine session based on url: {0}", e.Argument.Url); } }
private static void Site_OnWithdrawalFinished(object sender, GenericEventArgs e) { Console.WriteLine("Withdrawal Finished: " + e.Success); NextTest(); }
void DebugMessage2(object sender, GenericEventArgs<string> e) { // Pass up ((FFHLSRunner)caller).SendDebugMessage2(e.Value); }
public void UpdateButtonClickedHandler(object sender, GenericEventArgs<object> args) { _players = GetActivePlayers(); }
void _syncManager_SyncJobCreated(object sender, GenericEventArgs <SyncJobCreationResult> e) { _sessionManager.SendMessageToUserDeviceSessions(e.Argument.Job.TargetId, "SyncJobCreated", e.Argument, CancellationToken.None); }
private void ApiClientOnSyncJobUpdated(object sender, GenericEventArgs <CompleteSyncJobInfo> genericEventArgs) { Sync().ConfigureAwait(false); }
void _serverEvents_BrowseCommand(object sender, GenericEventArgs <BrowseRequest> e) { _presentationManager.Window.Dispatcher.InvokeAsync(OnRemoteControlCommand, DispatcherPriority.Background); }
private void ApplicationLocker_LockStatusChanged(object sender, GenericEventArgs <LockStatus> e) { OnLockStatusChanged(FamilialLocker.CurrentStatus, ApplicationRestrictor.CurrentStatus); _applicationRestrictorProxy.FireLockStatusChanged(e.Data); }
private void PlayAudio(object sender, GenericEventArgs <Stream> args) { // For SoundPlayer to be able to play the wav file, it has to be encoded in PCM. // Use output audio format AudioOutputFormat.Riff16Khz16BitMonoPcm to do that. this.Play(args.EventData); }
private void _organizationService_ItemAdded(object sender, GenericEventArgs <FileOrganizationResult> e) { _sessionManager.SendMessageToAdminSessions("AutoOrganize_ItemAdded", e.Argument, CancellationToken.None); }
private void OnDeviceDiscoveryDeviceDiscovered(object sender, GenericEventArgs <UpnpDeviceInfo> e) { NatUtility.Search(e.Argument.LocalIpAddress, NatProtocol.Upnp); }
private void TransactionRowWrapper_SelectTransactionEventHandler(object sender, GenericEventArgs <TransactionRowWrapper> e) { if (!m_MainTabControl.Contains(m_TabPage_ProcessingEnvironment)) { m_MainTabControl.Controls.Add(m_TabPage_ProcessingEnvironment); } m_TabPage_ProcessingEnvironment.Controls.Clear(); m_TabPage_ProcessingEnvironment.Controls.Add(e.Tag.GetUserControl().MainPanel); m_MainTabControl.SelectTab(m_TabPage_ProcessingEnvironment); }
private static void Site_OnResetSeedFinished(object sender, GenericEventArgs e) { Console.WriteLine("ResetSeed Finished: " + e.Success); NextTest(); }
private void OnProviderRefreshCompleted(object sender, GenericEventArgs <BaseItem> e) { OnProviderRefreshProgress(sender, new GenericEventArgs <Tuple <BaseItem, double> >(new Tuple <BaseItem, double>(e.Argument, 100))); _lastProgressMessageTimes.TryRemove(e.Argument.Id, out DateTime removed); }
private void OnProviderRefreshStarted(object sender, GenericEventArgs <BaseItem> e) { OnProviderRefreshProgress(sender, new GenericEventArgs <Tuple <BaseItem, double> >(new Tuple <BaseItem, double>(e.Argument, 0))); }
private void _textSource_KeyDown(object sender, GenericEventArgs <Keys> e) { _applyAutoIndent = e.Data == Keys.Enter; }
private void OnEntryCreated(object sender, GenericEventArgs <ActivityLogEntry> e) { SendData(true); }
private void _providerManager_RefreshCompleted(object sender, GenericEventArgs <BaseItem> e) { _providerManager_RefreshProgress(sender, new GenericEventArgs <Tuple <BaseItem, double> >(new Tuple <BaseItem, double>(e.Argument, 100))); }
/// <summary> /// Users the manager_ user deleted. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> void userManager_UserDeleted(object sender, GenericEventArgs <User> e) { SendMessageToUserSession(e.Argument, "UserDeleted", e.Argument.Id.ToString("N")); }
/// <summary> /// Installations the manager_ plugin uninstalled. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> void InstallationManager_PluginUninstalled(object sender, GenericEventArgs <IPlugin> e) { SendMessageToAdminSessions("PluginUninstalled", e.Argument.GetPluginInfo()); }
void _activityManager_EntryCreated(object sender, GenericEventArgs <ActivityLogEntry> e) { SendData(true); }
private void Component_LockStatusChanged(object sender, GenericEventArgs <LockStatus> e) => LockStatusChanged?.Invoke(sender, e);
protected virtual void RelatedMachinesFound(GenericEventArgs <IEnumerable <Machine> > e) { OnRelatedMachinesFound(this, e); }
/// <summary> /// Installations the manager_ plugin uninstalled. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> void InstallationManager_PluginUninstalled(object sender, GenericEventArgs <IPlugin> e) { _serverManager.SendWebSocketMessage("PluginUninstalled", e.Argument.GetPluginInfo()); }
private async void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs <UpnpDeviceInfo> e) { if (_disposed) { return; } var info = e.Argument; string usn; if (!info.Headers.TryGetValue("USN", out usn)) { usn = string.Empty; } string nt; if (!info.Headers.TryGetValue("NT", out nt)) { nt = string.Empty; } // Filter device type if (usn.IndexOf("WANIPConnection:", StringComparison.OrdinalIgnoreCase) == -1 && nt.IndexOf("WANIPConnection:", StringComparison.OrdinalIgnoreCase) == -1 && usn.IndexOf("WANPPPConnection:", StringComparison.OrdinalIgnoreCase) == -1 && nt.IndexOf("WANPPPConnection:", StringComparison.OrdinalIgnoreCase) == -1) { return; } var identifier = string.IsNullOrWhiteSpace(usn) ? nt : usn; if (info.Location == null) { return; } lock (_usnsHandled) { if (_usnsHandled.Contains(identifier)) { return; } _usnsHandled.Add(identifier); } _logger.Debug("Found NAT device: " + identifier); IPAddress address; if (IPAddress.TryParse(info.Location.Host, out address)) { // The Handle method doesn't need the port var endpoint = new IPEndPoint(address, info.Location.Port); IPAddress localAddress = null; try { var localAddressString = await _appHost.GetLocalApiUrl().ConfigureAwait(false); Uri uri; if (Uri.TryCreate(localAddressString, UriKind.Absolute, out uri)) { localAddressString = uri.Host; if (!IPAddress.TryParse(localAddressString, out localAddress)) { return; } } } catch (Exception ex) { return; } if (_disposed) { return; } _logger.Debug("Calling Nat.Handle on " + identifier); NatUtility.Handle(localAddress, info, endpoint, NatProtocol.Upnp); } }
void _userManager_UserConfigurationUpdated(object sender, GenericEventArgs <User> e) { var dto = _userManager.GetUserDto(e.Argument); SendMessageToUserSession(e.Argument, "UserConfigurationUpdated", dto); }
/// <summary> /// 在 TTS 请求失败时处理错误 /// </summary> private static void ErrorHandler(object sender, GenericEventArgs <Exception> e) { Console.WriteLine("Unable to complete the TTS request: [{0}]", e.ToString()); }
void Log_LineReceived(object sender, GenericEventArgs <string> e) { Output += $"{e.Value}\r\n"; }
/// <summary> /// Evaluates the given payload and retrieves active subscribers. /// </summary> /// <param name="args">Payload, that is beeing published.</param> /// <returns>List of actions to call.</returns> private List <Action <object[]> > PruneAndReturnStrategies(GenericEventArgs args) { List <Action <object[]> > returnList = new List <Action <object[]> >(); lock (dictionary) { Guid domainClassId = args.DomainClass.Id; if (dictionary.Keys.Contains(domainClassId)) { List <IEventSubscription> subscriptions = dictionary[domainClassId]; for (var i = subscriptions.Count - 1; i >= 0; i--) { Action <object[]> listItem = subscriptions[i].GetExecutionStrategy(); if (listItem == null) { // Prune from main list. Log? subscriptions.RemoveAt(i); } else { returnList.Add(listItem); } } if (subscriptions.Count == 0) { dictionary.Remove(domainClassId); } } // continue with descendants foreach (DomainClassInfo info in args.DomainClass.AllDescendants) { domainClassId = info.Id; if (dictionary.Keys.Contains(domainClassId)) { List <IEventSubscription> subscriptions = dictionary[domainClassId]; for (var i = subscriptions.Count - 1; i >= 0; i--) { Action <object[]> listItem = subscriptions[i].GetExecutionStrategy(); if (listItem == null) { // Prune from main list. Log? subscriptions.RemoveAt(i); } else { returnList.Add(listItem); } } if (subscriptions.Count == 0) { dictionary.Remove(domainClassId); } } } } return(returnList); }
// INCOMING debug void prober_DebugMessage(object sender, GenericEventArgs<string> e) { SendDebugMessage("Prober: " + e.Value); }
async void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs <UpnpDeviceInfo> e) { if (_disposed) { return; } var info = e.Argument; string usn; if (!info.Headers.TryGetValue("USN", out usn)) { usn = string.Empty; } string nt; if (!info.Headers.TryGetValue("NT", out nt)) { nt = string.Empty; } string location = info.Location.ToString(); // It has to report that it's a media renderer if (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1 && nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1) { //_logger.Debug("Upnp device {0} does not contain a MediaRenderer device (0).", location); return; } if (_sessionManager.Sessions.Any(i => usn.IndexOf(i.DeviceId, StringComparison.OrdinalIgnoreCase) != -1)) { return; } var cancellationToken = _disposeCancellationTokenSource.Token; await _sessionLock.WaitAsync(cancellationToken).ConfigureAwait(false); try { if (_disposed) { return; } await AddDevice(info, location, cancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) { } catch (Exception ex) { _logger.ErrorException("Error creating PlayTo device.", ex); } finally { _sessionLock.Release(); } }
void LiveTVPart_ErrorDataReceived4(object sender, GenericEventArgs<string> e) { if (StandardErrorReceivedLine4 != null) { if (e.Value == null) return; // this is actually required. wow. StandardErrorReceivedLine4(this, new GenericEventArgs<string>(e.Value)); } }
private void _textSource_Char(object sender, GenericEventArgs <char> e) { _applyAutoClose = e.Data == '>'; }
async void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs <UpnpDeviceInfo> e) { if (_disposed) { return; } var info = e.Argument; string usn; if (!info.Headers.TryGetValue("USN", out usn)) { usn = string.Empty; } string nt; if (!info.Headers.TryGetValue("NT", out nt)) { nt = string.Empty; } string location = info.Location.ToString(); // It has to report that it's a media renderer if (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1 && nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1) { return; } if (_sessionManager.Sessions.Any(i => usn.IndexOf(i.DeviceId, StringComparison.OrdinalIgnoreCase) != -1)) { return; } try { lock (_nonRendererUrls) { if ((DateTime.UtcNow - _lastRendererClear).TotalMinutes >= 10) { _nonRendererUrls.Clear(); _lastRendererClear = DateTime.UtcNow; } if (_nonRendererUrls.Contains(location, StringComparer.OrdinalIgnoreCase)) { return; } } var uri = info.Location; _logger.Debug("Attempting to create PlayToController from location {0}", location); var device = await Device.CreateuPnpDeviceAsync(uri, _httpClient, _config, _logger, _timerFactory).ConfigureAwait(false); if (device.RendererCommands == null) { lock (_nonRendererUrls) { _nonRendererUrls.Add(location); return; } } if (_disposed) { return; } _logger.Debug("Logging session activity from location {0}", location); var sessionInfo = await _sessionManager.LogSessionActivity(device.Properties.ClientType, _appHost.ApplicationVersion.ToString(), device.Properties.UUID, device.Properties.Name, uri.OriginalString, null) .ConfigureAwait(false); var controller = sessionInfo.SessionController as PlayToController; if (controller == null) { if (_disposed) { return; } string serverAddress; if (info.LocalIpAddress == null || info.LocalIpAddress.Equals(IpAddressInfo.Any) || info.LocalIpAddress.Equals(IpAddressInfo.IPv6Loopback)) { serverAddress = await GetServerAddress(null).ConfigureAwait(false); } else { serverAddress = await GetServerAddress(info.LocalIpAddress).ConfigureAwait(false); } string accessToken = null; sessionInfo.SessionController = controller = new PlayToController(sessionInfo, _sessionManager, _libraryManager, _logger, _dlnaManager, _userManager, _imageProcessor, serverAddress, accessToken, _deviceDiscovery, _userDataManager, _localization, _mediaSourceManager, _config, _mediaEncoder); controller.Init(device); var profile = _dlnaManager.GetProfile(device.Properties.ToDeviceIdentification()) ?? _dlnaManager.GetDefaultProfile(); _sessionManager.ReportCapabilities(sessionInfo.Id, new ClientCapabilities { PlayableMediaTypes = profile.GetSupportedMediaTypes(), SupportedCommands = new string[] { GeneralCommandType.VolumeDown.ToString(), GeneralCommandType.VolumeUp.ToString(), GeneralCommandType.Mute.ToString(), GeneralCommandType.Unmute.ToString(), GeneralCommandType.ToggleMute.ToString(), GeneralCommandType.SetVolume.ToString(), GeneralCommandType.SetAudioStreamIndex.ToString(), GeneralCommandType.SetSubtitleStreamIndex.ToString() }, SupportsMediaControl = true }); _logger.Info("DLNA Session created for {0} - {1}", device.Properties.Name, device.Properties.ModelName); } } catch (Exception ex) { _logger.ErrorException("Error creating PlayTo device.", ex); lock (_nonRendererUrls) { _nonRendererUrls.Add(location); } } }
private static void Site_Notify(object sender, GenericEventArgs e) { //Console.WriteLine("Notify Received: "+e.Message); //throw new NotImplementedException(); }