input: Write a function to convert a given Python program to a C# program. The function should take a Python function definition as input and return the equivalent C# function definition as output. If the input Python function is invalid or cannot be converted, the function should return an appropriate error message.
  assert convert_to_csharp("def power(x, y):\n    if y == 0:\n        return 1\n    else:\n        return x * power(x, y - 1)")=="public int Power(int x, int y)\n{\n    if (y == 0)\n    {\n        return 1;\n    }\n    else\n    {\n        return x * Power(x, y - 1);\n    }\n}"
  assert convert_to_csharp("def add(a, b):\n    return a + b")=="public int Add(int a, int b)\n{\n    return a + b;\n}"
  assert convert_to_csharp("def invalid_func(a, b):")=="Error: Invalid Python function definition"
  assert convert_to_csharp("")=="Error: Input Python function is empty"
output: def convert_to_csharp(python_func):
      if not python_func:
          return "Error: Input Python function is empty"
      
      lines = python_func.strip().split('\n')
      if not lines or not lines[0].startswith("def "):
          return "Error: Invalid Python function definition"
      
      func_def = lines[0].strip()
      func_name = func_def[4:func_def.index('(')]
      params = func_def[func_def.index('('):func_def.index(')')+1]
      param_list = params[1:-1].split(',')
      csharp_params = []
      
      for param in param_list:
          param = param.strip()
          if not param:
              return "Error: Invalid Python function definition"
          param_name = param.split(':')[0]
          csharp_params.append(f"int {param_name}")
      
      csharp_func = f"public int {func_name.capitalize()}({', '.join(csharp_params)})\n{{\n"
      
      for line in lines[1:]:
          line = line.strip()
          if line.startswith("return "):
              line = line.replace("return ", "return ") + ";"
          elif line.startswith("if "):
              line = line.replace("if ", "if (") + ")"
          elif line.startswith("else:"):
              line = "else"
          elif line.startswith("def "):
              return "Error: Invalid Python function definition"
          csharp_func += f"    {line}\n"
      
      csharp_func += "}"
      return csharp_func