Ejemplo n.º 1
0
        // public string Description { get; set; }


        internal BcfActionList(BcfAction pAction, Device pDevice, XmlNode pElement, int Modeindex)
        {
            mBcfAction   = pAction;
            mDevice      = pDevice;
            mDescription = pElement.Attributes["Description"].InnerText;
            mActionList  = new List <Action>();
            mModeIndex   = Modeindex;
            foreach (XmlNode node in pElement.ChildNodes)
            {
                try
                {
                    if (node.Name == ChangeDmxValue.XmlElementName)
                    {
                        Action act = new ChangeDmxValue(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == SceneMidiPlayer.XmlElementName)
                    {
                        Action act = new SceneMidiPlayer(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == AutoPress.XmlElementName)
                    {
                        Action act = new AutoPress(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == AutoSpeed.XmlElementName)
                    {
                        Action act = new AutoSpeed(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == SceneSpeed.XmlElementName)
                    {
                        Action act = new SceneSpeed(node);
                        //act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                }
                catch { }
            }
        }
Ejemplo n.º 2
0
        internal ActionList(XmlNode pElement)
        {
            mDeviceName  = pElement.Attributes["DeviceName"].InnerText;
            mCommand     = pElement.Attributes["Command"].InnerText;
            mMidiChannel = Convert.ToInt32(pElement.Attributes["MidiChannel"].InnerText);
            mData1       = Convert.ToInt32(pElement.Attributes["Data1"].InnerText);
            mKey         = Action.GetKey(mDeviceName, mCommand, mMidiChannel, mData1);
            mDescription = pElement.Attributes["Description"].InnerText;
            mActionList  = new List <Action>();

            foreach (XmlNode node in pElement.ChildNodes)
            {
                try
                {
                    if (node.Name == ChangeDmxValue.XmlElementName)
                    {
                        Action act = new ChangeDmxValue(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == SceneMidiPlayer.XmlElementName)
                    {
                        Action act = new SceneMidiPlayer(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == AutoPress.XmlElementName)
                    {
                        Action act = new AutoPress(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                    else if (node.Name == AutoSpeed.XmlElementName)
                    {
                        Action act = new AutoSpeed(node);
                        act.OnNewValueToSend += new OnNewValueToSendEvent(act_OnNewValueToSend);
                        mActionList.Add(act);
                    }
                }
                catch { }
            }
        }