Exemplo n.º 1
0
        public virtual void SetFieldAllowedValues(string propName, AllowedValue value)
        {
            if (FieldAllowedValues == null)
            {
                FieldAllowedValues = new Dictionary <string, AsyncObservableCollection <AllowedValue> >();
            }

            if (!FieldAllowedValues.ContainsKey(propName))
            {
                FieldAllowedValues.Add(propName, new AsyncObservableCollection <AllowedValue>());
            }

            AsyncObservableCollection <AllowedValue> propValues = FieldAllowedValues[propName];

            propValues.Add(value);
        }
Exemplo n.º 2
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Returns a list of all the allowed values for the given Product Studio field.  This
        /// assumes that this property does not depend on the value of any other property for
        /// its state.
        /// </summary>
        //------------------------------------------------------------------------------------
        public virtual AsyncObservableCollection <AllowedValue> GetFieldAllowedValues(string propName, AllowedValue firstValue = null)
        {
            AsyncObservableCollection <AllowedValue> allowedValues = GetFieldAllowedValues(CreateDSItem(), propName);

            if (allowedValues.Count == 0)
            {
                if (FieldAllowedValues.ContainsKey(propName))
                {
                    allowedValues = FieldAllowedValues[propName];
                }
            }

            if (firstValue != null)
            {
                allowedValues.Insert(0, firstValue);
            }

            return(allowedValues);
        }