Exemple #1
0
        private ODataStreamReferenceValue ReadStreamReferenceValue()
        {
            base.JsonReader.ReadStartObject();
            ODataStreamReferenceValue value2 = new ODataStreamReferenceValue();

            while (base.JsonReader.NodeType == JsonNodeType.Property)
            {
                string str6 = base.JsonReader.ReadPropertyName();
                if (str6 == null)
                {
                    goto Label_0186;
                }
                if (!(str6 == "edit_media"))
                {
                    if (str6 == "media_src")
                    {
                        goto Label_00BA;
                    }
                    if (str6 == "content_type")
                    {
                        goto Label_0106;
                    }
                    if (str6 == "media_etag")
                    {
                        goto Label_0146;
                    }
                    goto Label_0186;
                }
                if (value2.EditLink != null)
                {
                    throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonEntryAndFeedDeserializer_MultipleMetadataPropertiesForStreamProperty("edit_media"));
                }
                string propertyValue = base.JsonReader.ReadStringValue("edit_media");
                ODataJsonReaderUtils.ValidateMediaResourceStringProperty(propertyValue, "edit_media");
                value2.EditLink = base.ProcessUriFromPayload(propertyValue);
                continue;
Label_00BA:
                if (value2.ReadLink != null)
                {
                    throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonEntryAndFeedDeserializer_MultipleMetadataPropertiesForStreamProperty("media_src"));
                }
                string str3 = base.JsonReader.ReadStringValue("media_src");
                ODataJsonReaderUtils.ValidateMediaResourceStringProperty(str3, "media_src");
                value2.ReadLink = base.ProcessUriFromPayload(str3);
                continue;
Label_0106:
                if (value2.ContentType != null)
                {
                    throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonEntryAndFeedDeserializer_MultipleMetadataPropertiesForStreamProperty("content_type"));
                }
                string str4 = base.JsonReader.ReadStringValue("content_type");
                ODataJsonReaderUtils.ValidateMediaResourceStringProperty(str4, "content_type");
                value2.ContentType = str4;
                continue;
Label_0146:
                if (value2.ETag != null)
                {
                    throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonEntryAndFeedDeserializer_MultipleMetadataPropertiesForStreamProperty("media_etag"));
                }
                string str5 = base.JsonReader.ReadStringValue("media_etag");
                ODataJsonReaderUtils.ValidateMediaResourceStringProperty(str5, "media_etag");
                value2.ETag = str5;
                continue;
Label_0186:
                base.JsonReader.SkipValue();
            }
            base.JsonReader.ReadEndObject();
            return(value2);
        }