コード例 #1
0
        internal protected override object GetMapData(object[] attributes, string scope)
        {
            DataType itemDataType = null;
            Type     itemType     = null;

            ItemPropertyAttribute at = FindPropertyAttribute(attributes, scope + "/*");

            if (at != null)
            {
                itemType = at.ValueType;
                if (itemType == null)
                {
                    itemType = handler.GetItemType();
                }
                if (at.SerializationDataType != null)
                {
                    itemDataType = (DataType)Activator.CreateInstance(at.SerializationDataType, new object[] { itemType });
                }
            }

            if (itemType == null)
            {
                itemType = handler.GetItemType();
            }
            if (itemDataType == null)
            {
                itemDataType = Context.GetConfigurationDataType(itemType);
            }

            object itemMapData = itemDataType.GetMapData(attributes, scope + "/*");

            if (at == null && itemMapData == null)
            {
                return(null);
            }

            MapData data = new MapData();

            data.ItemType    = itemDataType;
            data.ItemName    = (at != null && at.Name != null) ? at.Name : itemDataType.Name;
            data.ItemMapData = itemMapData;
            return(data);
        }
コード例 #2
0
 internal void Initialize(object[] attributes, string scope)
 {
     mapData = dataType.GetMapData(attributes, scope);
 }