Exemplo n.º 1
0
        static void print(Any _any)
        {
            Console.WriteLine("As");
            Console.WriteLine(string.Format("int32: {0}", _any.AsInt32()));
            Console.WriteLine(string.Format("int64: {0}", _any.AsInt64()));
            Console.WriteLine(string.Format("float32: {0}", _any.AsFloat32()));
            Console.WriteLine(string.Format("float64: {0}", _any.AsFloat64()));
            Console.WriteLine(string.Format("bool: {0}", _any.AsBool()));
            Console.WriteLine(string.Format("string: {0}", _any.AsString()));
            Console.WriteLine(string.Format("bytes: {0} bytes", _any.AsBytes().Length));

            Console.WriteLine("As Ary");
            var ary1 = _any.AsInt32Ary();
            var ary2 = _any.AsInt64Ary();
            var ary3 = _any.AsFloat32Ary();
            var ary4 = _any.AsFloat64Ary();
            var ary5 = _any.AsBoolAry();
            var ary6 = _any.AsStringAry();

            Console.WriteLine("As Map");
            var map1 = _any.AsInt32Map();
            var map2 = _any.AsInt64Map();
            var map3 = _any.AsFloat32Map();
            var map4 = _any.AsFloat64Map();
            var map5 = _any.AsBoolMap();
            var map6 = _any.AsStringMap();
        }