Beispiel #1
0
        private void RePrepare(PropertyValueCollection propVals)
        {
            //If empty go for full rebuild
            if (propVals.Count == 0)
            {
                propertySnapshot = null;
                Prepare(propVals);
                return;
            }

            //Otherwise purge from the property values any properties not
            //in the snapshot
            List <PropertyValue> remove = new List <PropertyValue>();

            foreach (PropertyValue p in propVals)
            {
                if (!propertySnapshot.Contains(p.Name.Name))
                {
                    remove.Add(propVals.FindItem(p.Name.Name));
                }
            }
            if (remove.Count > 0)
            {
                foreach (PropertyValue propVal in remove)
                {
                    propVals.Remove(propVal);
                }
            }

            currentValues.Clear();
            //Re-cache property values into temp dictionary
            foreach (PropertyValue p in propVals)
            {
                currentValues[p.Name.Name] = p.Value as LiteralValue;
            }
        }
        private void RePrepare(PropertyValueCollection propVals)
        {
            //If empty go for full rebuild
            if (propVals.Count == 0)
            {
                propertySnapshot = null;
                Prepare(propVals);
                return;
            }

            //Otherwise purge from the property values any properties not 
            //in the snapshot
            List<PropertyValue> remove = new List<PropertyValue>();
            foreach (PropertyValue p in propVals)
            {
                if (!propertySnapshot.Contains(p.Name.Name))
                    remove.Add(propVals.FindItem(p.Name.Name));
            }
            if (remove.Count > 0)
            {
                foreach (PropertyValue propVal in remove)
                {
                    propVals.Remove(propVal);
                }
            }

            currentValues.Clear();
            //Re-cache property values into temp dictionary
            foreach (PropertyValue p in propVals)
            {
                currentValues[p.Name.Name] = p.Value as LiteralValue;
            }
        }