Esempio n. 1
0
        public void Serialize(SerializationEngine engine, IPropertySymbol property, ITypeSymbol type, CodeWriter code,
                              string name, string typeIdentifier, Location location)
        {
            var named = (INamedTypeSymbol)type;
            var types = named.TypeArguments;

            engine.AppendWriteLogic(property, types[0], code, $"{name}.Key", location);
            engine.AppendWriteLogic(property, types[1], code, $"{name}.Value", location);
        }
Esempio n. 2
0
        public void Serialize(SerializationEngine engine, IPropertySymbol property, ITypeSymbol type, CodeWriter code,
                              string name,
                              string typeIdentifier, Location location)
        {
            var named = (INamedTypeSymbol)type;
            var types = named.TypeArguments;

            for (var idx = 0; idx < Items; idx++)
            {
                var item = idx + 1;

                engine.AppendWriteLogic(property, types[idx], code, $"{name}.Item{item}", location);
            }
        }