Пример #1
0
        public static ClassSerializeType GetClassSerializeType(SyntaxList <AttributeListSyntax> attributes)
        {
            List <ClassSerializeType.ISerializeType> serializes = new List <ClassSerializeType.ISerializeType>();
            var useProtoContract = attributes.GetAttribute("ProtoContractAttribute") != null;

            if (useProtoContract)
            {
                serializes.Add(new ClassSerializeType.Protobuf());
            }

            var useMessagePack = attributes.GetAttribute("UnionAttribute") != null;

            if (useMessagePack)
            {
                serializes.Add(new ClassSerializeType.MessagePack());
            }
            return(new ClassSerializeType(serializes));
        }
Пример #2
0
 public static bool IsMessagePackObject(SyntaxList <AttributeListSyntax> attributes)
 {
     return(attributes.GetAttribute("UnionAttribute") != null);
 }