コード例 #1
0
        public override object ReadObject(XmlReader reader)
        {
            TwoWayAttachmentResponse TwoWayAttachmentResponseField = null;

            if (IsParentStartElement(reader, false, true))
            {
                TwoWayAttachmentResponseField         = new TwoWayAttachmentResponse();
                TwoWayAttachmentResponseField.AnyAttr = ReadAnyAttribute(reader);
                reader.Read();
                if (IsChildStartElement(reader, "Param", true, true))
                {
                    reader.Read();
                    if (IsAttribute(reader, "href"))
                    {
                        string contentID;
                        contentID = reader.Value;
                        reader.MoveToElement();
                        reader.ReadStartElement("Include", "http://www.w3.org/2004/08/xop/include");
                        reader.ReadEndElement();
                        TwoWayAttachmentResponseField.Param = GetBodyPartContent(contentID, BodyParts);
                    }
                    else
                    {
                        TwoWayAttachmentResponseField.Param = ConvertBase64.FromBase64String(reader.ReadString());
                        reader.ReadEndElement();
                    }
                }
                TwoWayAttachmentResponseField.Any = ReadAnyElement(reader, false);
                reader.ReadEndElement();
            }
            return(TwoWayAttachmentResponseField);
        }
コード例 #2
0
 public TwoWayAttachmentResponse TwoWayAttachment(TwoWayAttachmentRequest req)
 {
     System.Ext.Console.Write("TwoWayAttachment received.");
     System.Ext.Console.Write("Attachment size = " + req.Param.Length);
     System.Ext.Console.Write("");
     TwoWayAttachmentResponse resp = new TwoWayAttachmentResponse();
     HelpIcon testIcon = new HelpIcon();
     resp.Param = testIcon.Data.ToArray();
     return resp;
 }
コード例 #3
0
        public TwoWayAttachmentResponse TwoWayAttachment(TwoWayAttachmentRequest req)
        {
            System.Ext.Console.Write("TwoWayAttachment received.");
            System.Ext.Console.Write("Attachment size = " + req.Param.Length);
            System.Ext.Console.Write("");
            TwoWayAttachmentResponse resp = new TwoWayAttachmentResponse();
            HelpIcon testIcon             = new HelpIcon();

            resp.Param = testIcon.Data.ToArray();
            return(resp);
        }
コード例 #4
0
        public override void WriteObject(XmlWriter writer, object graph)
        {
            TwoWayAttachmentResponse TwoWayAttachmentResponseField = ((TwoWayAttachmentResponse)(graph));

            if (WriteParentElement(writer, true, true, graph))
            {
                WriteAnyAttribute(writer, TwoWayAttachmentResponseField.AnyAttr);
                if (WriteChildElement(writer, "Param", true, true, TwoWayAttachmentResponseField.Param))
                {
                    BodyParts.Add(CreateNewBodyPart(TwoWayAttachmentResponseField.Param, "<3@body>"));
                    writer.WriteStartElement("xop", "Include", "http://www.w3.org/2004/08/xop/include");
                    writer.WriteAttributeString(null, "href", null, "cid:3@body");
                    writer.WriteEndElement();
                    writer.WriteEndElement();
                }
                WriteAnyElement(writer, TwoWayAttachmentResponseField.Any, false);
                writer.WriteEndElement();
            }
            return;
        }
コード例 #5
0
 public override object ReadObject(XmlReader reader)
 {
     TwoWayAttachmentResponse TwoWayAttachmentResponseField = null;
     if (IsParentStartElement(reader, false, true))
     {
         TwoWayAttachmentResponseField = new TwoWayAttachmentResponse();
         TwoWayAttachmentResponseField.AnyAttr = ReadAnyAttribute(reader);
         reader.Read();
         if (IsChildStartElement(reader, "Param", true, true))
         {
             reader.Read();
             if (IsAttribute(reader, "href"))
             {
                 string contentID;
                 contentID = reader.Value;
                 reader.MoveToElement();
                 reader.ReadStartElement("Include", "http://www.w3.org/2004/08/xop/include");
                 reader.ReadEndElement();
                 TwoWayAttachmentResponseField.Param = GetBodyPartContent(contentID, BodyParts);
             }
             else
             {
                 TwoWayAttachmentResponseField.Param = Convert.FromBase64String(reader.ReadString());
                 reader.ReadEndElement();
             }
         }
         TwoWayAttachmentResponseField.Any = ReadAnyElement(reader, false);
         reader.ReadEndElement();
     }
     return TwoWayAttachmentResponseField;
 }