Skip to content

Instantly share code, notes, and snippets.

@Suchiman
Created November 23, 2014 04:45
Show Gist options
  • Select an option

  • Save Suchiman/1b17967908160487c3ed to your computer and use it in GitHub Desktop.

Select an option

Save Suchiman/1b17967908160487c3ed to your computer and use it in GitHub Desktop.
class XMPPXmlWriter : XmlTextWriter
{
Action<bool> WriteEndStartTag;
public XMPPXmlWriter(Stream w, Encoding encoding)
: base(w, encoding)
{
Type baseClass = typeof(XmlTextWriter);
MethodInfo WEST = baseClass.GetMethod("WriteEndStartTag", BindingFlags.Instance | BindingFlags.NonPublic);
WriteEndStartTag = (Action<bool>)WEST.CreateDelegate(typeof(Action<bool>), this);
}
public void WriteStartTagEnde()
{
WriteEndStartTag(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment