Пример #1
0
        public void RemoveEscherProperty(int num)
        {
            List <EscherProperty> toRemove = new List <EscherProperty>();

            for (IEnumerator <EscherProperty> iterator = EscherProperties.GetEnumerator(); iterator.MoveNext();)
            {
                EscherProperty prop = iterator.Current;
                if (prop.PropertyNumber == num)
                {
                    //iterator.Remove();
                    toRemove.Add(prop);
                }
            }
            foreach (EscherProperty e in toRemove)
            {
                EscherProperties.Remove(e);
            }
        }
Пример #2
0
        /**
         * Set an escher property. If a property with given propId already
         * exists it is replaced.
         *
         * @param value the property to set.
         */

        public void SetEscherProperty(EscherProperty value)
        {
            List <EscherProperty> toRemove = new List <EscherProperty>();

            for (IEnumerator <EscherProperty> iterator =
                     properties.GetEnumerator(); iterator.MoveNext();)
            {
                EscherProperty prop = iterator.Current;
                if (prop.Id == value.Id)
                {
                    //iterator.Remove();
                    toRemove.Add(prop);
                }
            }
            foreach (EscherProperty e in toRemove)
            {
                EscherProperties.Remove(e);
            }
            properties.Add(value);
            SortProperties();
        }