Example #1
0
        internal static void SerializeViaElement <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                                 string elementName, ref ListLimitTraits traits)
            where TDoc : class
            where TCursor : class
        {
            s.StreamElement(elementName, ref traits.MaxCount);

            if (s.IsReading)
            {
                traits.InitializeBitLengths();
            }
        }
Example #2
0
        internal static void SerializeViaElementOpt <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                                    string elementName, ref ListLimitTraits traits)
            where TDoc : class
            where TCursor : class
        {
            bool streamed = s.StreamElementOpt(elementName, ref traits.MaxCount, Predicates.IsNotZero);

            if (streamed && s.IsReading)
            {
                traits.InitializeBitLengths();
            }
        }