Esempio n. 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);
        }
Esempio n. 2
0
        /// <summary>
        /// Froms the token.
        /// </summary>
        /// <param name="arg">The argument.</param>
        /// <returns>IRelationType.</returns>
        public static JsonRelationType FromToken(JToken arg)
        {
            var instance = new JsonRelationType(arg);

            return(instance);
        }