Exception_MissingArgument.cs 785 B

12345678910111213141516171819202122
  1. using System.Collections.Generic;
  2. namespace System.Net.HomeMatic.Exceptions {
  3. public class Exception_MissingArgument : Exception {
  4. public Exception_MissingArgument(string[] RequiredArguments)
  5. : base("The called Api Function requires arguments: "+ String.Join(", ",RequiredArguments)) {
  6. }
  7. public Exception_MissingArgument(string[][] RequiredArguments)
  8. : base("The called Api Function requires arguments: " + sJoin(RequiredArguments)) {
  9. }
  10. public static string sJoin(string[][] s2) {
  11. List<string> res = new List<string>();
  12. foreach (string[] s1 in s2) {
  13. res.Add(String.Join(" or ", s1));
  14. }
  15. return String.Join(", ", res.ToArray());
  16. }
  17. }
  18. }