示例#1
0
        public bool LoadFromXML(XmlNode node)
        {
            if (node.Attributes["id"] != null)
            {
                ID = node.Attributes["id"].Value;
            }

            if (node.Attributes["channel"] != null)
            {
                int i = 0;
                int.TryParse(node.Attributes["channel"].Value, out i);
                Channel = i;
            }

            if (node.Attributes["macro"] != null)
            {
                Macro = node.Attributes["macro"].Value;
            }

            XmlNodeList nl = node.SelectNodes("keys/key");
            for (int j = 0; j < nl.Count; j++)
            {
                PatternAutomationKey pn = new PatternAutomationKey();
                if (pn.LoadFromXML(nl[j]))
                    Keys.Add(pn);
            }

            return true;
        }
示例#2
0
 public PatternAutomationKey Clone()
 {
     PatternAutomationKey ret = new PatternAutomationKey();
     ret.ID = ID;
     ret.Time = Time;
     ret.Value = Value;
     return ret;
 }