Example #1
0
        /// <summary>
        /// Froms the token.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <returns>JsonLink.</returns>
        public static JsonLink FromToken(JToken content)
        {
            JsonRelationType relationType = GetRelationType(content);
            JsonLink         instance;

            if (relationType.IsWorkItemLink)
            {
                instance = JsonRelatedLink.FromToken(content);
            }
            else if (relationType.Name == "Attached File")
            {
                instance = new JsonAttachedFileLink(content);
            }
            else if (relationType.Name == "Hyperlink")
            {
                instance = new JsonHyperlink(content);
            }
            else
            {
                instance = new JsonLink(content);
            }
            return(instance);
        }
 /// <summary>
 /// Froms the token.
 /// </summary>
 /// <param name="token">The token.</param>
 /// <returns>JsonAttachedFileLink.</returns>
 public new static JsonAttachedFileLink FromToken(JToken token)
 {
     return((JsonAttachedFileLink)JsonLink.FromToken(token));
 }
Example #3
0
 /// <summary>
 /// Froms the token.
 /// </summary>
 /// <param name="token">The token.</param>
 /// <returns>JsonHyperlink.</returns>
 public new static JsonHyperlink FromToken(JToken token)
 {
     return((JsonHyperlink)JsonLink.FromToken(token));
 }