protected void WriteEndElement(object o)
{
_w.WriteEndElement();
if (o != null && _objectsInUse != null)
{
#if DEBUG
// use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
if (!objectsInUse.ContainsKey(o)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "missing stack object of type " + o.GetType().FullName));
#endif
_objectsInUse.Remove(o);
}
}