Beispiel #1
0
 void WriteQueuedTypeSamples(XmlTextWriter xtw)
 {
     for (int n = 0; n < queue.Count; n++)
     {
         EncodedType          ec = (EncodedType)queue[n];
         XmlSchemaComplexType st = FindComplexTyype(ec.Element.SchemaTypeName);
         WriteComplexTypeSample(xtw, st, ec.Element.SchemaTypeName, n + 1);
     }
 }
Beispiel #2
0
        }     //Label_UPCA

        #endregion
        #endregion

        #region Misc
        private string GetXML()
        {
#if PocketPC
            return("not implemented");
#else
            if (EncodedValue == "")
            {
                throw new Exception("EGETXML-1: Could not retrieve XML due to the barcode not being encoded first.  Please call Encode first.");
            }
            else
            {
                try
                {
                    using (BarcodeXML xml = new BarcodeXML())
                    {
                        BarcodeXML.BarcodeRow row = xml.Barcode.NewBarcodeRow();
                        row.Type         = EncodedType.ToString();
                        row.RawData      = RawData;
                        row.EncodedValue = EncodedValue;
                        row.EncodingTime = EncodingTime;
                        row.IncludeLabel = IncludeLabel;
                        row.Forecolor    = ColorTranslator.ToHtml(ForeColor);
                        row.Backcolor    = ColorTranslator.ToHtml(BackColor);
                        row.CountryAssigningManufacturingCode = Country_Assigning_Manufacturer_Code;
                        row.ImageWidth     = Width;
                        row.ImageHeight    = Height;
                        row.RotateFlipType = this.RotateFlipType;
                        row.LabelPosition  = (int)this.LabelPosition;
                        row.LabelFont      = this.LabelFont.ToString();
                        row.ImageFormat    = this.ImageFormat.ToString();
                        row.Alignment      = (int)this.Alignment;

                        //get image in base 64
                        using (MemoryStream ms = new MemoryStream())
                        {
                            EncodedImage.Save(ms, ImageFormat);
                            row.Image = Convert.ToBase64String(ms.ToArray(), Base64FormattingOptions.None);
                        }//using

                        xml.Barcode.AddBarcodeRow(row);

                        StringWriter sw = new StringWriter();
                        xml.WriteXml(sw, XmlWriteMode.WriteSchema);
                        return(sw.ToString());
                    } //using
                }     //try
                catch (Exception ex)
                {
                    throw new Exception("EGETXML-2: " + ex.Message);
                } //catch
            }     //else
#endif
        }
Beispiel #3
0
        private string GetXML()
        {
            if (EncodedValue == "")
            {
                throw new Exception("EGETXML-1: Could not retrieve XML due to the barcode not being encoded first.  Please call Encode first.");
            }
            else
            {
                try
                {
                    using (SaveData xml = new SaveData())
                    {
                        xml.Type         = EncodedType.ToString();
                        xml.RawData      = RawData;
                        xml.EncodedValue = EncodedValue;
                        xml.EncodingTime = EncodingTime;
                        xml.IncludeLabel = IncludeLabel;
                        xml.Forecolor    = ColorTranslator.ToHtml(ForeColor);
                        xml.Backcolor    = ColorTranslator.ToHtml(BackColor);
                        xml.CountryAssigningManufacturingCode = Country_Assigning_Manufacturer_Code;
                        xml.ImageWidth     = Width;
                        xml.ImageHeight    = Height;
                        xml.RotateFlipType = RotateFlipType;
                        xml.LabelPosition  = (int)LabelPosition;
                        xml.LabelFont      = LabelFont.ToString();
                        xml.ImageFormat    = ImageFormat.ToString();
                        xml.Alignment      = (int)Alignment;

                        using (MemoryStream ms = new MemoryStream())
                        {
                            EncodedImage.Save(ms, ImageFormat);
                            xml.Image = Convert.ToBase64String(ms.ToArray(), Base64FormattingOptions.None);
                        }

                        XmlSerializer writer = new XmlSerializer(typeof(SaveData));
                        StringWriter  sw     = new StringWriter();
                        writer.Serialize(sw, xml);
                        return(sw.ToString());
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("EGETXML-2: " + ex.Message);
                }
            }
        }
        }//CheckNumericOnly

        private string GetXML()
        {
            if (EncodedValue == "")
            {
                throw new System.Exception("EGETXML-1: Could not retrieve XML due to the barcode not being encoded first.  Please call Encode first.");
            }
            else
            {
                try
                {
                    using (PawnUtilities.BarcodeGenerator.BarcodeXML xml = new PawnUtilities.BarcodeGenerator.BarcodeXML())
                    {
                        PawnUtilities.BarcodeGenerator.BarcodeXML.BarcodeRow row = xml.Barcode.NewBarcodeRow();
                        row.Type         = EncodedType.ToString();
                        row.RawData      = RawData;
                        row.EncodedValue = EncodedValue;
                        row.EncodingTime = EncodingTime;
                        row.IncludeLabel = IncludeLabel;
                        row.Forecolor    = ColorTranslator.ToHtml(ForeColor);
                        row.Backcolor    = ColorTranslator.ToHtml(BackColor);
                        row.CountryAssigningManufacturingCode = Country_Assigning_Manufacturer_Code;
                        row.ImageWidth  = Width;
                        row.ImageHeight = Height;

                        //get image in base 64
                        using (MemoryStream ms = new MemoryStream())
                        {
                            EncodedImage.Save(ms, getImageFormat(ImageFormat));
                            row.Image = Convert.ToBase64String(ms.ToArray(), Base64FormattingOptions.None);
                        }//using

                        xml.Barcode.AddBarcodeRow(row);

                        StringWriter sw = new StringWriter();
                        xml.WriteXml(sw, XmlWriteMode.WriteSchema);
                        return(sw.ToString());
                    } //using
                }     //try
                catch (System.Exception ex)
                {
                    throw new System.Exception("EGETXML-2: " + ex.Message);
                } //catch
            }     //else
        }
        private string GetXML()
        {
            if (string.IsNullOrEmpty(EncodedValue))
            {
                throw new Exception(
                          "EGETXML-1: Could not retrieve XML due to the barcode not being encoded first.  Please call Encode first.");
            }
            try
            {
                using (var xml = new BarcodeXML())
                {
                    var row = xml.Barcode.NewBarcodeRow();
                    row.Type         = EncodedType.ToString();
                    row.RawData      = RawData;
                    row.EncodedValue = EncodedValue;
                    row.EncodingTime = EncodingTime;
                    row.IncludeLabel = IncludeLabel;
                    row.Forecolor    = ColorTranslator.ToHtml(ForeColor);
                    row.Backcolor    = ColorTranslator.ToHtml(BackColor);
                    row.CountryAssigningManufacturingCode = Country_Assigning_Manufacturer_Code;
                    row.ImageWidth  = Width;
                    row.ImageHeight = Height;

                    //get image in base 64
                    using (var ms = new MemoryStream())
                    {
                        EncodedImage.Save(ms, ImageFormat);
                        row.Image = Convert.ToBase64String(ms.ToArray(), Base64FormattingOptions.None);
                    }

                    xml.Barcode.AddBarcodeRow(row);

                    var sw = new StringWriter();
                    xml.WriteXml(sw, XmlWriteMode.WriteSchema);
                    return(sw.ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("EGETXML-2: " + ex.Message);
            }
        }