예제 #1
0
 public CallbackCommand(XmlElement el)
 {
     type = (CallbackType)Enum.Parse(typeof(CallbackType), el.Name.Replace('-', '_'), true);
     id = el.GetAttribute("id");
     command = (Callback.Command) Enum.Parse(typeof(Callback.Command), el.GetAttribute("command"), true);
     XmlNodeList childs = el.ChildNodes;
     for (int i = 0; i < childs.Count; i++)
     {
         XmlNode node = childs.Item(i);
         if (node.Name.Equals("after"))
         {
             XmlNodeList l = node.ChildNodes;
             if (l.Count > 0)
             {
                 afterCmd = new Tuple((XmlElement) l.Item(0));
             }
         }
         else if (node.Name.Equals("before"))
         {
             XmlNodeList l = node.ChildNodes;
             if (l.Count > 0)
             {
                 beforeCmd = new Tuple((XmlElement) l.Item(0));
             }
         }
     }
     //XmlNodeList list = el.GetElementsByTagName("tuple");
     //XmlNode node = list[0];
     //tuple = new Tuple((XmlElement)node);
     if (el.GetAttribute("seq") != null)
     {
         seq = int.Parse(el.GetAttribute("seq"));
     }
 }
예제 #2
0
 public CallbackCommand(Callback.Command command, Tuple afterCmd, Tuple beforeCmd, int major, int minor, int version, String user, int seq, CallbackType type)
 {
     this.command = command;
     this.afterCmd = afterCmd;
     this.beforeCmd = beforeCmd;
     this.major = major;
     this.minor = minor;
     this.version = version;
     this.user = user;
     this.seq = seq;
     this.type = type;
 }