Ejemplo n.º 1
0
        /**
         * Add a new double property
         *
         * @throws IllegalArgumentException if a property with this name already exists
         */

        public void AddProperty(string name, double value)
        {
            CT_Property p = Add(name);

            p.ItemElementName = ItemChoiceType.r8;
            p.Item            = value;
        }
Ejemplo n.º 2
0
        /**
         * Add a new bool property
         *
         * @throws IllegalArgumentException if a property with this name already exists
         */

        public void AddProperty(string name, bool value)
        {
            CT_Property p = Add(name);

            p.ItemElementName = ItemChoiceType.@bool;
            p.Item            = value;
        }
Ejemplo n.º 3
0
        /**
         * Add a new string property
         *
         * @throws IllegalArgumentException if a property with this name already exists
         */

        public void AddProperty(string name, String value)
        {
            CT_Property p = Add(name);

            p.ItemElementName = ItemChoiceType.lpwstr;
            p.Item            = value;
        }
Ejemplo n.º 4
0
            /**
             * Add a new integer property
             *
             * @throws IllegalArgumentException if a property with this name already exists
             */
            public void AddProperty(String name, int value)
            {
                CT_Property p = Add(name);

                p.ItemElementName = ItemChoiceType.i4;
                p.Item            = value;
            }
Ejemplo n.º 5
0
            public void AddProperty(string name, bool value)
            {
                CT_Property ctProperty = this.Add(name);

                ctProperty.ItemElementName = ItemChoiceType.@bool;
                ctProperty.Item            = (object)value;
            }
Ejemplo n.º 6
0
            private CT_Property Add(string name)
            {
                if (this.Contains(name))
                {
                    throw new ArgumentException("A property with this name already exists in the custom properties");
                }
                CT_Property ctProperty = this.props.GetProperties().AddNewProperty();
                int         num        = this.NextPid();

                ctProperty.pid   = num;
                ctProperty.fmtid = POIXMLProperties.CustomProperties.FORMAT_ID;
                ctProperty.name  = name;
                return(ctProperty);
            }
Ejemplo n.º 7
0
        /**
         * Add a new property
         *
         * @param name the property name
         * @throws IllegalArgumentException if a property with this name already exists
         */

        private CT_Property Add(string name)
        {
            if (Contains(name))
            {
                throw new ArgumentException("A property with this name " +
                                            "already exists in the custom properties");
            }

            CT_Property p   = props.GetProperties().AddNewProperty();
            int         pid = NextPid();

            p.pid   = pid;
            p.fmtid = FORMAT_ID;
            p.name  = name;
            return(p);
        }