public InvokeResultDescriptor(String content, InvokeContentType contentType)
     : this(content)
 {
     ContentType = contentType;
 }
 public InvokeResultDescriptor(String content, InvokeContentType contentType)
     : this(content)
 {
     ContentType = contentType;
 }
        internal static InvokeResultDescriptor Deserialize(XmlReader reader)
        {
            if (reader != null)
            {
                try
                {
                    if (!(reader.NodeType == XmlNodeType.Element &&
                          reader.Name == "InvokeResultDescriptor"))
                    {
                        reader.ReadToFollowing("InvokeResultDescriptor");
                    }

                    InvokeResultDescriptor target = new InvokeResultDescriptor();
                    // Начало - InvokeResultDescriptor
                    reader.ReadStartElement("InvokeResultDescriptor");

                    // Свойства
                    reader.ReadStartElement("Content");
                    if (reader.NodeType == XmlNodeType.Text)
                    {
                        target.Content = reader.ReadContentAsString();
                        reader.ReadEndElement();
                    }

                    reader.ReadStartElement("ContentType");
                    if (reader.NodeType == XmlNodeType.Text)
                    {
                        target.ContentType = (InvokeContentType)(InvokeContentType.Parse(typeof(InvokeContentType), reader.ReadContentAsString(), true));
                        reader.ReadEndElement();
                    }

                    reader.ReadStartElement("IsArchive");
                    if (reader.NodeType == XmlNodeType.Text)
                    {
                        target.IsArchive = bool.Parse(reader.ReadContentAsString());
                        reader.ReadEndElement();
                    }

                    // Элементы
                    Header header = null;
                    reader.ReadStartElement("Headers");
                    do
                    {
                        header = Header.Deserialize(reader);
                        if (header != null)
                        {
                            target.Headers.Add(header);
                        }
                    } while (header != null);
                    if (reader.NodeType == XmlNodeType.EndElement &&
                        reader.Name == "Headers")
                    {
                        reader.ReadEndElement();
                    }

                    // Конец - InvokeResultDescriptor
                    if (reader.NodeType == XmlNodeType.EndElement &&
                        reader.Name == "InvokeResultDescriptor")
                    {
                        reader.ReadEndElement();
                    }
                    return(target);
                }
                catch (XmlException)
                {
                    throw;
                    //return null;
                }
            }
            return(null);
        }