public void InsertElement(int index, IBackgroundSoundChoice element) { BackgroundSoundChoice bsc = element as BackgroundSoundChoice; m_Container.InsertGeneralElement(index, bsc.ParallelElement); m_Elements.Insert(index, bsc); }
internal static void WriteAdditionalData(System.Xml.XmlWriter writer, IBackgroundSoundChoice choice) { writer.WriteStartElement("ParallelElementData"); writer.WriteAttributeString("FixedStartDelay", choice.FixedStartDelay.TotalMilliseconds.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("RandomStartDelay", choice.MaximumRandomStartDelay.TotalMilliseconds.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("FixedInterDelay", choice.FixedIntermediateDelay.TotalMilliseconds.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("RandomInterDelay", choice.MaximumRandomIntermediateDelay.TotalMilliseconds.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString("RepeatCount", choice.RepeatCount.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); }
public void RemoveElement(Int32 id) { IBackgroundSoundChoice element = m_Elements.Find(e => e.Id == id); if (element != null) { m_Elements.Remove(element); m_Container.RemoveElement((element as BackgroundSoundChoice).ParallelElement.Id); } }
public void SetBGSoundChoice(IBackgroundSoundChoice bgSoundChoice, IProject project) { ElementId = bgSoundChoice.Id; m_Element = bgSoundChoice; delayableControl.SetElement(bgSoundChoice, project); repeatableControl.SetElement(bgSoundChoice, project); choiceContainerControl.SetContainer(bgSoundChoice, project, false); volumeControl.SetElement(bgSoundChoice, project); label1.Text = String.Format(label1.Text, String.Format(StringResources.FileExplorerTitle, StringResources.Sounds)); ElementSet(project); }
public override void Do(Ares.Data.IProject project) { m_Parent.Nodes.Remove(m_Node); IBackgroundSoundChoice soundChoice = (m_Node.Tag as IBackgroundSoundChoice); IBackgroundSounds bgSounds = m_Parent.Tag as IBackgroundSounds; bgSounds.RemoveElement(soundChoice.Id); Data.DataModule.ElementRepository.DeleteElement(soundChoice.Id); Ares.ModelInfo.ModelChecks.Instance.CheckAll(project); ElementRemoval.NotifyRemoval(soundChoice); ElementChanges.Instance.ElementChanged(bgSounds.Id); }
public IModeElement GetModeElementDefinition(ITargetDirectoryProvider targetDirectoryProvider) { IElementContainer <IParallelElement> container = DataModule.ElementFactory.CreateParallelContainer("Test-Szenario"); IModeElement modeElement = DataModule.ElementFactory.CreateModeElement("Test-Szenario", container); IRandomBackgroundMusicList music = DataModule.ElementFactory.CreateRandomBackgroundMusicList("Musik"); container.AddElement(music); IBackgroundSounds sounds = DataModule.ElementFactory.CreateBackgroundSounds("Sounds"); container.AddElement(sounds); IBackgroundSoundChoice soundChoice1 = sounds.AddElement("Auswahl 1"); music.AddElement(DataModule.ElementFactory.CreateFileElement(targetDirectoryProvider.GetPathWithinLibrary(m_MusicResource), SoundFileType.Music)); soundChoice1.AddElement(DataModule.ElementFactory.CreateFileElement(targetDirectoryProvider.GetPathWithinLibrary(m_SoundResource), SoundFileType.SoundEffect)); return(modeElement); }