/// <summary> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mRemoveButton_Click(object sender, EventArgs e) { UI.Resources.SoundInfo soundToRemove = this.SelectedSound; if (soundToRemove == null) { return; } if (GetReferences(soundToRemove).Length > 0) { return; } mScene.Sounds.Remove(soundToRemove); UpdateListView(mScene.Sounds); }
/// <summary> /// Converts the font count to its string representation /// </summary> /// <param name="context"></param> /// <param name="culture"></param> /// <param name="value"></param> /// <param name="destinationType"></param> /// <returns></returns> public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(string)) { UI.Actions.SoundAction soundAction = context.Instance as UI.Actions.SoundAction; if (soundAction != null) { UI.Resources.SoundInfo sound = soundAction.Scene.GetSoundInfo(soundAction.Sound); if (sound != null) { return(sound.Name); } } } return("None"); }
/// <summary> /// ToString override /// </summary> /// <returns></returns> public override string ToString() { if (this.Scene != null) { UI.Resources.SoundInfo soundInfo = this.Scene.GetSoundInfo(mSoundID); if (soundInfo != null) { return("Play Sound : '" + soundInfo.Name + "'"); } else { return("Send Sound : '<nil>'"); } } return("Send Message ID : " + mSoundID); }