public void setTriggerData(TriggerData aData)
        {
            if (aData == null)
            {
                mFilename = "";
                TriggerEvent = TriggerMessage.Null();
            }

            Filename = aData.Filename;
            TriggerEvent = aData.Message;
            loadFile();
        }
        public TriggerData GetTriggerData()
        {
            TriggerData tData = new TriggerData(mFilename, mTrigger);

            return tData;
        }
 public TriggerPanel(TriggerData aData) : this()
 {
     setTriggerData(aData);
 }
예제 #4
0
        private Set getSetFromFile(string aFile)
        {
            Set tSet = new Set();

            using (System.IO.StreamReader tFile = new System.IO.StreamReader(aFile))
            {
                using (XmlReader tReader = XmlReader.Create(tFile))
                {
                    XmlDocument xml = new XmlDocument();
                    xml.Load(tReader);

                    tSet = new Set();

                    XmlNode xSet = xml.SelectSingleNode("Set");
                    if (xSet.Attributes.Count > 0)
                    {
                        XmlAttribute tAt = xSet.Attributes["Name"];
                        tSet.Name = tAt.Value;
                    }

                    XmlNodeList tList = xml.SelectNodes("/Set/Song");

                    foreach (XmlNode xSong in tList)
                    {
                        Song tS = new Song();
                        if (xSong.Attributes.Count > 0)
                            tS.Name = xSong.Attributes["Name"].Value;

                        foreach (XmlNode xTrig in xSong.ChildNodes)
                        { 
                            TriggerData tData = new TriggerData();
                            tData.Filename = xTrig["Filename"].InnerText;

                            TriggerMessage tTrig = new TriggerMessage();
                            XmlNode xMes = xTrig["Message"];
                            tTrig.stEvent = xMes["Event"].InnerText;
                            tTrig.stRawMessage = Convert.ToInt32(xMes["RawMessage"].InnerText);

                            tData.Message = tTrig;

                            tS.TriggerDataList.Add(tData);
                        }

                        tSet.SongList.Add(tS);
                    }

                }
            }

            return tSet;
        }