public void MediaStatusChange(MediaState.MEDIASTATUSPROPERTYTAG[] Tags, object[] Properties) { Trace.TraceInformation("Session.MediaStatusChange called"); //Check to see if the socket server is valid if (Sink.SocketServer == null) { Trace.TraceError("SocketServer is null"); return; } try { for (int i = 0; i < Tags.Length; i++) { var tag = (MediaState.MEDIASTATUSPROPERTYTAG)Tags.GetValue(i); var value = Properties.GetValue(i); // Remove duplicate notifications if ((tag == prevCheckTag) && (value.ToString() == prevCheckProp.ToString())) { return; } prevCheckTag = tag; prevCheckProp = value; Trace.TraceInformation("Tag {0}={1}", tag, value); Sink.SocketServer.SendMessage( string.Format(CultureInfo.InvariantCulture, "{0}={1}\r\n", tag, value) ); MediaState.UpdateState(tag, value); } } catch (Exception ex) { Trace.TraceError("Exception: {0}", ex.ToString()); } }
public void MediaStatusChange(MediaState.MEDIASTATUSPROPERTYTAG[] Tags, object[] Properties) { Trace.TraceInformation("Session.MediaStatusChange called"); //Check to see if the socket server is valid if (Sink.SocketServer == null) { Trace.TraceError("SocketServer is null"); return; } try { for (int i = 0; i < Tags.Length; i++) { var tag = (MediaState.MEDIASTATUSPROPERTYTAG)Tags.GetValue(i); var value = Properties.GetValue(i); // Remove duplicate notifications if ((tag == prevCheckTag) && (value.ToString() == prevCheckProp.ToString())) { return; } prevCheckTag = tag; prevCheckProp = value; Trace.TraceInformation("Tag {0}={1}", tag, value); Sink.SocketServer.SendMessage( string.Format(CultureInfo.InvariantCulture, "{0}={1}\r\n", tag, value) ); MediaState.UpdateState(tag, value); } } catch (Exception ex) { Trace.TraceError("Exception: {0}", ex.ToString()); } }