コード例 #1
0
        public override IList Elements()
        {
            PropertyList propertyList = dataPrototype.Info().CreatePropertyList();

            DataField[] keyFields = dataPrototype.Info().GetKeyFields();
            if (keyFields.Length > 1)
            {
                throw new UnsupportedOperationException();
            }
            for (int i = 0; i < keyFields.Length; i++)
            {
                propertyList.AddProperty(keyFields[i].GetFieldName());
            }
            propertyList.AddProperty(dataPrototype.Info().GetTitleField().GetFieldName());
            ICollection collection = GetAllDataCollection(propertyList);
            ArrayList   list       = new ArrayList(collection == null ? 0 : collection.Count);

            if (collection != null)
            {
                for (IEnumerator i = collection.GetEnumerator(); i.MoveNext();)
                {
                    DataContent data = (DataContent)i.Current;
                    list.Add(
                        new Element(
                            data.GetDataKey().KeyPartAt(0),
                            data.GetProperty(dataPrototype.Info().GetTitleField().GetFieldName()).ToString()
                            )
                        );
                }
            }
            return(list);
        }
コード例 #2
0
 public DataContentChoiceType(bool nullable, DataContent dataPrototype) : base(nullable, dataPrototype.Info().GetKeyFields()[0].getFieldType())
 {
     this.dataPrototype = dataPrototype;
 }