public AddSoundChoiceAction(TreeNode parent, IBackgroundSounds bgSounds, IXmlWritable importedElement, NodeCreator nodeCreator, out TreeNode node) { m_Parent = parent; m_Element = bgSounds.AddImportedElement(importedElement); m_Node = nodeCreator(m_Element); m_Index = m_Parent.Nodes.Count; bgSounds.RemoveElement(m_Element.Id); node = m_Node; m_BGSounds = bgSounds; }
public AddSoundChoiceAction(TreeNode parent, IBackgroundSounds bgSounds, String name, NodeCreator nodeCreator, out TreeNode node) { m_Parent = parent; m_Element = bgSounds.AddElement(name); m_Node = nodeCreator(m_Element); m_Index = m_Parent.Nodes.Count; bgSounds.RemoveElement(m_Element.Id); node = m_Node; m_BGSounds = bgSounds; }
public override void Undo(Ares.Data.IProject project) { m_Parent.Nodes.Insert(m_Index, m_Node); IBackgroundSounds bgSounds = m_Parent.Tag as IBackgroundSounds; bgSounds.InsertElement(m_Index, (m_Node.Tag as IBackgroundSoundChoice)); Data.DataModule.ElementRepository.AddElement((m_Node.Tag as IBackgroundSoundChoice)); Ares.ModelInfo.ModelChecks.Instance.CheckAll(project); ElementRemoval.NotifyUndo(m_Node.Tag as IBackgroundSoundChoice); ElementChanges.Instance.ElementChanged(bgSounds.Id); }
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); }