GetValue() public method

public GetValue ( DatabaseTable owner ) : object
owner Cornerstone.Database.Tables.DatabaseTable
return object
コード例 #1
0
        public HashSet <string> GetAllValues <T>(DBField field, DBRelation relation, ICollection <T> items) where T : DatabaseTable
        {
            // loop through all items in the DB and grab all existing values for this field
            HashSet <string> uniqueStrings = new HashSet <string>(StringComparer.CurrentCultureIgnoreCase);

            foreach (T currItem in items)
            {
                if (relation == null)
                {
                    List <string> values = getValues(field.GetValue(currItem));
                    foreach (string currStr in values)
                    {
                        uniqueStrings.Add(currStr);
                    }
                }
                else
                {
                    foreach (DatabaseTable currSubItem in relation.GetRelationList(currItem))
                    {
                        List <string> values = getValues(field.GetValue(currSubItem));
                        foreach (string currStr in values)
                        {
                            uniqueStrings.Add(currStr);
                        }
                    }
                }
            }

            return(uniqueStrings);
        }
コード例 #2
0
        public HashSet <string> GetAllValues(DBField field)
        {
            ICollection items = Get(field.OwnerType, null);

            // loop through all items in the DB and grab all existing values for this field
            HashSet <string> uniqueStrings = new HashSet <string>(StringComparer.CurrentCultureIgnoreCase);

            foreach (DatabaseTable currItem in items)
            {
                List <string> values = getValues(field.GetValue(currItem));
                foreach (string currStr in values)
                {
                    uniqueStrings.Add(currStr);
                }
            }

            return(uniqueStrings);
        }