Example #1
0
        public static Data EncodeWithSpec(this IProperty prop)
        {
            Data data = prop.Encode();

            if (data != null)
            {
                Data spec = null;
                prop.AllValueCheckers <ISpecValueChecker>((ISpecValueChecker checker) => {
                    if (spec == null)
                    {
                        spec = new Data();
                    }
                    checker.DoEncode(spec);
                });
                if (spec != null && spec.Count > 0)
                {
                    data.SetData(SpecConsts.KeySpec, spec);
                }
            }
            return(data);
        }