コード例 #1
0
        public HashSet <string> GetFieldAllowedValuesSet(string propName)
        {
            HashSet <string> valueSet = new HashSet <string>();
            DatastoreItem    dsItem   = CreateDSItem();

            ProductStudio.Field  field  = dsItem.Fields[propName];
            ProductStudio.Values values = field.ValidValues;
            foreach (object value in values)
            {
                valueSet.Add(value as string);
            }

            return(valueSet);
        }
コード例 #2
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Returns a list of all the allowed values for the given Product Studio field, given
        /// the current state of the given item.
        /// </summary>
        //------------------------------------------------------------------------------------
        private AsyncObservableCollection <AllowedValue> GetFieldAllowedValues(DatastoreItem dsItem, string propName)
        {
            AsyncObservableCollection <AllowedValue> valueList = new AsyncObservableCollection <AllowedValue>();

            if (dsItem != null)
            {
                ProductStudio.Field  field  = dsItem.Fields[propName];
                ProductStudio.Values values = field.ValidValues;
                foreach (object value in values)
                {
                    valueList.Add(new AllowedValue {
                        Value = value
                    });
                }

                ResetDSItem(dsItem);
            }

            return(valueList);
        }