예제 #1
0
        public static AtomLink CreateEditMediaLink(Uri href, string contentType, CultureInfo contentLanguage)
        {
            AtomLink link = AtomMemberResources.CreateEditMediaLink(href, contentType);

            link.ContentLanguage = contentLanguage;
            return(link);
        }
예제 #2
0
        /// <summary>
        /// Creates a new <see cref="AtomLink"/> that can be used to modify a media resource associated with an <see cref="AtomEntry"/> using the supplied parameters.
        /// </summary>
        /// <param name="href">A <see cref="Uri"/> that represents an IRI that can be used to modify a media resource associated with an <see cref="AtomEntry"/>.</param>
        /// <param name="contentType">An advisory MIME media type that provides a hint about the type of the representation that is expected to be returned by the Web resource.</param>
        /// <returns>A <see cref="AtomLink"/> object that can be can be used to modify a media resource associated with an <see cref="AtomEntry"/>.</returns>
        /// <remarks>
        ///     <para>
        ///         The <see cref="AtomLink"/> that is returned has a <see cref="AtomLink.Relation"/> of <b>edit-media</b>. The value of <i>edit-media</i> specifies
        ///         that the value of the <paramref name="href"/> attribute is an IRI that can be used to modify a media resource associated with an <see cref="AtomEntry"/>.
        ///     </para>
        ///     <para>
        ///         An <see cref="AtomEntry"/> <i>may</i> contain zero or more <i>edit-media</i> link relations.
        ///         An <see cref="AtomEntry"/> <b>must not</b> contain more than one <see cref="AtomLink"/> with a <see cref="AtomLink.Relation"/> value of <i>edit-media</i>
        ///         that has the same <see cref="AtomLink.ContentType"/> and <see cref="AtomLink.ContentLanguage"/> values.
        ///         All <i>edit-media</i> link relations in the same <see cref="AtomEntry"/> reference the same Resource.
        ///         If a client encounters multiple <i>edit-media</i> link relations in an <see cref="AtomEntry"/> then it <i>should</i> choose a link based on the client
        ///         preferences for <see cref="AtomLink.ContentType"/> and <see cref="AtomLink.ContentLanguage"/>. If a client encounters multiple <i>edit-media</i> link relations
        ///         in an <see cref="AtomEntry"/> and has no preference based on the <see cref="AtomLink.ContentType"/> and <see cref="AtomLink.ContentLanguage"/> then the
        ///         client <i>should</i> pick the first <i>edit-media</i> link relation in document order.
        ///     </para>
        /// </remarks>
        /// <exception cref="ArgumentNullException">The <paramref name="href"/> is a null reference (Nothing in Visual Basic).</exception>
        public static AtomLink CreateEditMediaLink(Uri href, string contentType)
        {
            AtomLink link = AtomMemberResources.CreateEditMediaLink(href);

            link.ContentType = contentType;
            return(link);
        }