public bool ValidateArgs(UPnPArgument[] Args) { int count = this.ArgList.Count; if (this.HasReturnValue) { count--; } if (Args.Length != count) { throw new UPnPInvokeException(this.Name, Args, "Incorrect number of Args"); } for (int i = 0; i < Args.Length; i++) { UPnPArgument arg = this.GetArg(Args[i].Name); if (arg == null) { throw new UPnPInvokeException(this.Name, Args, Args[i].Name + " was not found in action: " + this.Name); } if (arg.Direction == "in") { try { arg.RelatedStateVar.Validate(Args[i].DataValue); } catch (Exception exception) { throw new UPnPInvokeException(this.Name, Args, exception.Message); } } } return(true); }
internal void AddArgument(UPnPArgument Arg) { Arg.ParentAction = this; this.ArgList.Add(Arg); }