Ejemplo n.º 1
0
        public static JsonReadWriteDelegates GetGeneratedReadWriteDelegates(DataContract c)
        {
            // this method used to be rewritten by an IL transform
            // with the restructuring for multi-file, this is no longer true - instead
            // this has become a normal method
            JsonReadWriteDelegates result;

            return(JsonReadWriteDelegates.GetJsonDelegates().TryGetValue(c, out result) ? result : null);
        }
Ejemplo n.º 2
0
        internal static JsonReadWriteDelegates GetReadWriteDelegatesFromGeneratedAssembly(DataContract c)
        {
            JsonReadWriteDelegates result = GetGeneratedReadWriteDelegates(c);

            if (result == null)
            {
                throw new InvalidDataContractException(SR.Format(SR.SerializationCodeIsMissingForType, c.UnderlyingType));
            }
            else
            {
                return(result);
            }
        }
Ejemplo n.º 3
0
        public static JsonReadWriteDelegates GetGeneratedReadWriteDelegates(DataContract c)
        {
            // this method used to be rewritten by an IL transform
            // with the restructuring for multi-file, this is no longer true - instead
            // this has become a normal method
            JsonReadWriteDelegates result;

#if NET_NATIVE
            // The c passed in could be a clone which is different from the original key,
            // We'll need to get the original key data contract from generated assembly.
            DataContract keyDc = DataContract.GetDataContractFromGeneratedAssembly(c.UnderlyingType);
            return(JsonReadWriteDelegates.GetJsonDelegates().TryGetValue(keyDc, out result) ? result : null);
#else
            return(JsonReadWriteDelegates.GetJsonDelegates().TryGetValue(c, out result) ? result : null);
#endif
        }
Ejemplo n.º 4
0
        internal static JsonReadWriteDelegates TryGetReadWriteDelegatesFromGeneratedAssembly(DataContract c)
        {
            JsonReadWriteDelegates result = GetGeneratedReadWriteDelegates(c);

            return(result);
        }