private void InvokeCallback(int message, double value, bool removeHandler) { var status = new Media.MediaStatus() { Id = this.id, MsgType = message }; if (message == MediaError) { status.Value = new Media.MediaError() { Code = (int)value }; } else { status.Value = value; } this.handler.ReportStatus(status); }