示例#1
0
        private void ParseNotification(JObject jObject)
        {
            if (jObject["method"] != null)
            {
                string _method;
                _method = jObject["method"].ToString();
                switch (_method)
                {
                case "Application.OnVolumeChanged":
                    Application.RaiseOnVolumeChanged(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Application.OnVolumeChanged_data>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnCleanFinished":
                    AudioLibrary.RaiseOnCleanFinished(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnCleanStarted":
                    AudioLibrary.RaiseOnCleanStarted(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnExport":
                    AudioLibrary.RaiseOnExport(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.AudioLibrary.OnExport_data>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnRemove":
                    AudioLibrary.RaiseOnRemove(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.AudioLibrary.OnRemove_data>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnScanFinished":
                    AudioLibrary.RaiseOnScanFinished(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnScanStarted":
                    AudioLibrary.RaiseOnScanStarted(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "AudioLibrary.OnUpdate":
                    AudioLibrary.RaiseOnUpdate(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.AudioLibrary.OnUpdate_data>(Serializer)
                        );
                    break;

                case "GUI.OnDPMSActivated":
                    GUI.RaiseOnDPMSActivated(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "GUI.OnDPMSDeactivated":
                    GUI.RaiseOnDPMSDeactivated(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "GUI.OnScreensaverActivated":
                    GUI.RaiseOnScreensaverActivated(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "GUI.OnScreensaverDeactivated":
                    GUI.RaiseOnScreensaverDeactivated(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.GUI.OnScreensaverDeactivated_data>(Serializer)
                        );
                    break;

                case "Input.OnInputFinished":
                    Input.RaiseOnInputFinished(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "Input.OnInputRequested":
                    Input.RaiseOnInputRequested(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Input.OnInputRequested_data>(Serializer)
                        );
                    break;

                case "Player.OnPause":
                    Player.RaiseOnPause(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Player.Notifications.Data>(Serializer)
                        );
                    break;

                case "Player.OnPlay":
                    Player.RaiseOnPlay(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Player.Notifications.Data>(Serializer)
                        );
                    break;

                case "Player.OnPropertyChanged":
                    Player.RaiseOnPropertyChanged(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Player.OnPropertyChanged_data>(Serializer)
                        );
                    break;

                case "Player.OnSeek":
                    Player.RaiseOnSeek(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Player.OnSeek_data>(Serializer)
                        );
                    break;

                case "Player.OnSpeedChanged":
                    Player.RaiseOnSpeedChanged(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Player.Notifications.Data>(Serializer)
                        );
                    break;

                case "Player.OnStop":
                    Player.RaiseOnStop(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Player.OnStop_data>(Serializer)
                        );
                    break;

                case "Playlist.OnAdd":
                    Playlist.RaiseOnAdd(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Playlist.OnAdd_data>(Serializer)
                        );
                    break;

                case "Playlist.OnClear":
                    Playlist.RaiseOnClear(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Playlist.OnClear_data>(Serializer)
                        );
                    break;

                case "Playlist.OnRemove":
                    Playlist.RaiseOnRemove(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.Playlist.OnRemove_data>(Serializer)
                        );
                    break;

                case "System.OnLowBattery":
                    System.RaiseOnLowBattery(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "System.OnQuit":
                    System.RaiseOnQuit(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.System.OnQuit_data>(Serializer)
                        );
                    break;

                case "System.OnRestart":
                    System.RaiseOnRestart(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "System.OnSleep":
                    System.RaiseOnSleep(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "System.OnWake":
                    System.RaiseOnWake(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnCleanFinished":
                    VideoLibrary.RaiseOnCleanFinished(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnCleanStarted":
                    VideoLibrary.RaiseOnCleanStarted(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnExport":
                    VideoLibrary.RaiseOnExport(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.VideoLibrary.OnExport_data>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnRemove":
                    VideoLibrary.RaiseOnRemove(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.VideoLibrary.OnRemove_data>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnScanFinished":
                    VideoLibrary.RaiseOnScanFinished(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnScanStarted":
                    VideoLibrary.RaiseOnScanStarted(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <object>(Serializer)
                        );
                    break;

                case "VideoLibrary.OnUpdate":
                    VideoLibrary.RaiseOnUpdate(
                        jObject["params"]["sender"].ToObject <string>(Serializer)
                        , jObject["params"]["data"].ToObject <KodiRpc.VideoLibrary.OnUpdate_data>(Serializer)
                        );
                    break;
                }
            }
        }