2

I want to get the comments of the xml file for the .dll file.

I am building an proxy class creator (reads an .dll (by Reflection) with interfaces in it --> implements interfaces) and now I thought it would be nice to have the headers of the methods and parameters of the interfaces, but I don't know how.

Thank you for your Answers and pardon my bad english and poor coding knowledge.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Bio42
  • 389
  • 3
  • 18

1 Answers1

1

I found a Solution:

   private static void ReadTheSummarys()
    {
      XmlReader xmlReader = XmlReader.Create("Test.xml");
      bool isSummary = false;
      while (xmlReader.Read())
    {
    //checks if the current node is a summaray
    if (xmlReader.Name == "summary")
    {
      isSummary = true;
      continue;
    }

    if (isSummary)
    {
      //Replace and trim for pure Comments without spaces and linefeeds
      string summary = xmlReader.Value.Trim().Replace("\n", string.Empty);
      if (summary != string.Empty)
      {
        //Writes the pure comment for checking
        Console.WriteLine(summary);           
      }
    isSummary = false;
    }

    }

    }
Key_coder
  • 534
  • 3
  • 27
Bio42
  • 389
  • 3
  • 18