/// <summary>
        /// 按照tab属性来给属性分组
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, SchemaPropertyValueCollection> GroupByTab()
        {
            Dictionary <string, SchemaPropertyValueCollection> result = new Dictionary <string, SchemaPropertyValueCollection>();

            foreach (SchemaPropertyValue spv in this)
            {
                SchemaPropertyValueCollection spvc = null;

                if (result.TryGetValue(spv.Definition.Tab, out spvc) == false)
                {
                    spvc = new SchemaPropertyValueCollection();

                    result.Add(spv.Definition.Tab, spvc);
                }

                spvc.Add(spv);
            }

            return(result);
        }
Beispiel #2
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            string schemaType = DictionaryHelper.GetValue(dictionary, "schemaType", string.Empty);

            VersionedSchemaObjectBase schemaObjectBase = CreateInstance(schemaType, dictionary, type, serializer);

            schemaObjectBase.ID               = DictionaryHelper.GetValue(dictionary, "id", string.Empty);;
            schemaObjectBase.Status           = DictionaryHelper.GetValue(dictionary, "status", SchemaObjectStatus.Normal);
            schemaObjectBase.VersionStartTime = DictionaryHelper.GetValue(dictionary, "versionStartTime", DateTime.MinValue);
            schemaObjectBase.VersionEndTime   = DictionaryHelper.GetValue(dictionary, "versionEndTime", DateTime.MinValue);

            if (dictionary.ContainsKey("Properties") == true)
            {
                SchemaPropertyValueCollection propCollection = JSONSerializerExecute.Deserialize <SchemaPropertyValueCollection>(dictionary["Properties"]);
                schemaObjectBase.Properties.Clear();
                schemaObjectBase.Properties.CopyFrom(propCollection);
            }

            return(schemaObjectBase);
        }