Beispiel #1
0
        /// <summary>
        /// Return an instance of the class representing the properties.
        /// This method is called at design time;
        /// </summary>
        /// <returns></returns>
        public object GetPropertiesInstance(XmlNode iNode)
        {
            BarCodeProperties bcp = new BarCodeProperties(this, iNode);

            foreach (XmlNode n in iNode.ChildNodes)
            {
                if (n.Name != "CustomProperty")
                {
                    continue;
                }
                string pname = this.GetNamedElementValue(n, "Name", "");
                switch (pname)
                {
                case "ProductCode":
                    bcp.SetProductCode(GetNamedElementValue(n, "Value", "00000"));
                    break;

                case "ManufacturerCode":
                    bcp.SetManufacturerCode(GetNamedElementValue(n, "Value", "00000"));
                    break;

                case "NumberSystem":
                    bcp.SetNumberSystem(GetNamedElementValue(n, "Value", "00"));
                    break;

                default:
                    break;
                }
            }

            return(bcp);
        }
Beispiel #2
0
        public void SetPropertiesInstance(XmlNode node, object inst)
        {
            node.RemoveAll();       // Get rid of all properties

            BarCodeProperties bcp = inst as BarCodeProperties;

            if (bcp == null)
            {
                return;
            }


            XmlHelpers.CreateChild(node, "Code", bcp.Code);
        }
Beispiel #3
0
        public object GetPropertiesInstance(XmlNode iNode)
        {
            BarCodeProperties bcp = new BarCodeProperties(this, iNode);
            foreach (XmlNode n in iNode.ChildNodes)
            {
                if (n.Name != "CustomProperty")
                    continue;
                string pname = XmlHelpers.GetNamedElementValue(n, "Name", "");
                switch (pname)
                {
                    case "Code":
                        bcp.SetBarCode(XmlHelpers.GetNamedElementValue(n, "Value", ""));
                        break;
                    default:
                        break;
                }
            }

            return bcp;
        }
Beispiel #4
0
        /// <summary>
        /// Set the custom properties given the properties object
        /// </summary>
        /// <param name="node"></param>
        /// <param name="inst"></param>
        public void SetPropertiesInstance(XmlNode node, object inst)
        {
            node.RemoveAll();       // Get rid of all properties

            BarCodeProperties bcp = inst as BarCodeProperties;

            if (bcp == null)
            {
                return;
            }

            // NumberSystem
            CreateChild(node, "NumberSystem", bcp.NumberSystem);

            // ManufacturerCode
            CreateChild(node, "ManufacturerCode", bcp.ManufacturerCode);

            // ProductCode
            CreateChild(node, "ProductCode", bcp.ProductCode);
        }
Beispiel #5
0
        public object GetPropertiesInstance(XmlNode iNode)
        {
            BarCodeProperties bcp = new BarCodeProperties(this, iNode);

            foreach (XmlNode n in iNode.ChildNodes)
            {
                if (n.Name != "CustomProperty")
                {
                    continue;
                }
                string pname = XmlHelpers.GetNamedElementValue(n, "Name", "");
                switch (pname)
                {
                case "Code":
                    bcp.SetBarCode(XmlHelpers.GetNamedElementValue(n, "Value", ""));
                    break;

                default:
                    break;
                }
            }

            return(bcp);
        }
        /// <summary>
        /// Return an instance of the class representing the properties.
        /// This method is called at design time;
        /// </summary>
        /// <returns></returns>
        public object GetPropertiesInstance(XmlNode iNode)
        {
            BarCodeProperties bcp = new BarCodeProperties(this, iNode);
            foreach (XmlNode n in iNode.ChildNodes)
            {
                if (n.Name != "CustomProperty") 
                    continue;
                string pname = this.GetNamedElementValue(n, "Name", "");
                switch (pname)
                {
                    case "ProductCode":
                        bcp.SetProductCode(GetNamedElementValue(n, "Value", "00000"));
                        break;
                    case "ManufacturerCode":
                        bcp.SetManufacturerCode(GetNamedElementValue(n, "Value", "00000"));
                        break;
                    case "NumberSystem":
                        bcp.SetNumberSystem(GetNamedElementValue(n, "Value", "00"));
                        break;
                    default:
                        break;
                }
            }

            return bcp;
        }