Beispiel #1
0
        /// <summary>
        /// Clones this action
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            SoundAction clone = new SoundAction();

            clone.Scene = this.Scene;
            clone.Sound = this.Sound;
            clone.Volume = this.Volume;

            return clone;
        }
Beispiel #2
0
        /// <summary>
        /// Clones this action
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            SoundAction clone = new SoundAction();

            clone.Scene  = this.Scene;
            clone.Sound  = this.Sound;
            clone.Volume = this.Volume;

            return(clone);
        }
Beispiel #3
0
        static void serializer_UnknownElement(object sender, XmlElementEventArgs e)
        {
            // We changed from "ActionLists" to "MainChannelFrames"
            if (e.Element.Name == "ActionLists")
            {
                GUIAnimation guiAnimation = e.ObjectBeingDeserialized as GUIAnimation;
                guiAnimation.MainChannelFrames.Clear();

                foreach (XmlNode actionsListsNode in e.Element.ChildNodes)
                {
                    if (actionsListsNode.Name != "ActionList")
                    {
                        continue;
                    }

                    MainChannelFrame mcf = new MainChannelFrame();
                    mcf.Frame = uint.Parse(actionsListsNode.Attributes["Frame"].Value);
                    guiAnimation.MainChannelFrames.Add(mcf);

                    foreach (XmlNode actionListNode in actionsListsNode.ChildNodes)
                    {
                        if (actionListNode.Name != "Actions")
                        {
                            continue;
                        }

                        foreach (XmlNode actionsNode in actionListNode.ChildNodes)
                        {
                            Actions.Action action = null;

                            if (actionsNode.Name == "SoundAction")
                            {
                                Actions.SoundAction soundAction = new Actions.SoundAction();
                                soundAction.Sound  = int.Parse(actionsNode.Attributes["Sound"].Value);
                                soundAction.Volume = uint.Parse(actionsNode["Volume"].InnerText);

                                action = soundAction;
                            }
                            else if (actionsNode.Name == "MessageAction")
                            {
                                Actions.MessageAction messageAction = new Actions.MessageAction();
                                messageAction.Message = int.Parse(actionsNode.Attributes["Message"].Value);

                                action = messageAction;
                            }

                            if (action != null)
                            {
                                mcf.Actions.Add(action);
                            }
                        }
                    }
                }
            }
        }