private void PopulateSoundSettings()
        {
            var soundSettings = new SoundSettings()
            {
                PlayRewindSound = rewindCheckBox.Checked,
                PlayTickingSound = tickingSoundcheckBox.Checked,
                PlayRingSound = ringSoundcheckBox.Checked,
            };

            this.plugins.CherryCommands["Set Sound Settings"].Do(
                new SoundSettingsCommandArgs(soundSettings));
        }
Exemplo n.º 2
0
 public void LoadConfiguration(ConfigurePluginEventArgs cpea)
 {
     XmlElement fromElement = cpea.GetMyNode(this.PluginName);
     if (fromElement != null)
     {
         this.Enabled = bool.Parse(fromElement.GetAttribute("enabled"));
         this.soundSettings = new SoundSettings()
         {
             PlayRewindSound = bool.Parse(fromElement.GetAttribute("playRewindSound")),
             PlayTickingSound = bool.Parse(fromElement.GetAttribute("playTickingSound")),
             PlayRingSound = bool.Parse(fromElement.GetAttribute("playRingSound")),
         };
     }
 }
        public SoundController()
        {
            this.Enabled = true;

            this.soundSettings.PlayRewindSound = true;
            this.soundSettings.PlayTickingSound = true;
            this.soundSettings.PlayRingSound = true;

            this.getSettingsCommand = new CherryCommand(
                "Get Sound Settings",
                ca => this.soundSettings,
                "Returns current SoundSettings object. The settings were read from configuration.");
            this.setSettingsCommand = new CherryCommand(
                "Set Sound Settings",
                ssca => this.soundSettings = (ssca as SoundSettingsCommandArgs).Settings,
                "Set the new sound settings.");
            this.playSoundCommand = new CherryCommand(
                "Play Sound",
                psca => this.Play((psca as PlaySoundCommandArgs).FileName),
                "Plays the given file. The sound is played once.");
        }
Exemplo n.º 4
0
        public SoundController()
        {
            this.Enabled = true;

            this.soundSettings.PlayRewindSound = true;
            this.soundSettings.PlayTickingSound = true;
            this.soundSettings.PlayRingSound = true;

            this.getSettingsCommand = new CherryCommand(
                "Get Sound Settings",
                ca => this.soundSettings,
                "Returns current SoundSettings object. The settings were read from configuration.");
            this.setSettingsCommand = new CherryCommand(
                "Set Sound Settings",
                ssca => this.soundSettings = (ssca as SoundSettingsCommandArgs).Settings,
                "Set the new sound settings.");
            this.playSoundCommand = new CherryCommand(
                "Play Sound",
                psca => this.Play((psca as PlaySoundCommandArgs).FileName),
                "Plays the given file. The sound is played once.");
        }
 public SoundSettingsCommandArgs(SoundSettings settings)
 {
     this.Settings = settings;
 }
 public void LoadConfiguration(ConfigurePluginEventArgs cpea)
 {
     XmlElement fromElement = cpea.GetMyNode(this.PluginName);
     if (fromElement != null)
     {
         this.Enabled = bool.Parse(fromElement.GetAttribute("enabled"));
         this.soundSettings = new SoundSettings()
         {
             PlayRewindSound = bool.Parse(fromElement.GetAttribute("playRewindSound")),
             PlayTickingSound = bool.Parse(fromElement.GetAttribute("playTickingSound")),
             PlayRingSound = bool.Parse(fromElement.GetAttribute("playRingSound")),
         };
     }
 }
Exemplo n.º 7
0
 public SoundSettingsCommandArgs(SoundSettings settings)
 {
     this.Settings = settings;
 }