public ProtobufPacketGenerator(string className, int packetID, BoundTo boundTo, State state) { ClassName = className; PacketID = packetID; BoundTo = boundTo; State = state; }
public virtual bool Search(string[] args, object item) { if (args.Any(a => a == this.Command)) { BoundTo.SetValue(item, true, null); return(true); } return(false); }
public override bool Search(string[] args, object item) { if (base.Search(args, item)) { int idx = args.ToList().IndexOf(Command); if ((idx + 1) < args.Length) { string toTest = args[idx + 1]; if (Pattern.IsMatch(toTest)) { BoundTo.SetValue(item, toTest, null); return(true); } this.BindingErros.Add(String.Format("Wrong argument for command {1} needs to match {0}", Pattern, this.Command)); } else { this.BindingErros.Add(String.Format("Missing argument {0} for command {1}", ArgsExplained.Trim(), this.Command)); } } return(false); }