Exemplo n.º 1
0
        internal static ContentAny Read(IUpdateDecoder decoder)
        {
            var length = decoder.ReadLength();
            var cs     = new List <object>(length);

            for (int i = 0; i < length; i++)
            {
                var c = decoder.ReadAny();
                cs.Add(c);
            }

            return(new ContentAny(cs));
        }
Exemplo n.º 2
0
Arquivo: YDoc.cs Projeto: alex521/ycs
        internal static YDocOptions Read(IUpdateDecoder decoder)
        {
            var dict = (IDictionary <string, object>)decoder.ReadAny();

            var result = new YDocOptions();

            result.Gc       = dict.ContainsKey("gc") ? (bool)dict["gc"] : true;
            result.Guid     = dict.ContainsKey("guid") ? dict["guid"].ToString() : System.Guid.NewGuid().ToString("D");
            result.Meta     = dict.ContainsKey("meta") ? dict["meta"] as Dictionary <string, string> : null;
            result.AutoLoad = dict.ContainsKey("autoLoad") ? (bool)dict["autoLoad"] : false;

            return(result);
        }