Exemplo n.º 1
0
        public async Task <IceCatProduct> GetAsync(long productId)
        {
            var req = RequestEngine.CreateClient(_AccessConfig);

            var productXmlUrl = BuildXmlFileUrl($"{productId}.xml");

            var productXml = await RequestEngine.GetAsStringAsync(req, productXmlUrl);

            return(CustomXmlParser.Parse <IceCatProduct>(productXml, "Product"));
        }
Exemplo n.º 2
0
        public async Task <string> GetAsync(string xmlUrlPath, string nodeName = null)
        {
            var req = RequestEngine.CreateClient(_AccessConfig);

            var xmlBody = await RequestEngine.GetAsStringAsync(req, xmlUrlPath);

            if (string.IsNullOrEmpty(nodeName))
            {
                return(xmlBody);
            }

            return(await CustomXmlParser.ParseAsync(nodeName, xmlBody));
        }
Exemplo n.º 3
0
        protected void ManipulatePdf(String dest)
        {
            PdfDocument pdfDoc = new PdfDocument(new PdfReader(SRC), new PdfWriter(dest));
            Document    doc    = new Document(pdfDoc);
            PdfAcroForm form   = PdfAcroForm.GetAcroForm(pdfDoc, true);

            // If no fields have been explicitly included, then all fields are flattened.
            // Otherwise only the included fields are flattened.
            form.FlattenFields();

            Rectangle pos = form.GetField("Name").GetWidgets()[0].GetRectangle().ToRectangle();

            // Custom parser gets position of the form field
            // to fill in the document with the parsed content.
            CustomXmlParser parser = new CustomXmlParser(doc, pos);

            parser.Parse("<root><div>Bruno <u>Lowagie</u></div></root>");

            pdfDoc.Close();
        }
Exemplo n.º 4
0
 public IEnumerable <IceCatFile> List()
 {
     return(CustomXmlParser.ParseFileToList <IceCatFile>(XmlFilePath, "file"));
 }
Exemplo n.º 5
0
 public ActionResult ConvertToXML(string txtInputText)
 {
     ViewBag.ParsedText = CustomXmlParser.ToXml(txtInputText);
     ViewBag.Mode       = "xml";
     return(View("Index"));
 }
Exemplo n.º 6
0
 protected void btnConvertToXML_Click(object sender, EventArgs e)
 {
     txtResultXML.Text = CustomXmlParser.ToXml(txtInputText.Text);
 }