Company updates
Inheritance: StatusUpdateRecord
Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="source">Update node</param>
        public static LinkedinCompanyShare MakeRecord(XElement source, IRecord profileRecord)
        {
            LinkedinCompanyShare result = new LinkedinCompanyShare();

            result.StatusID      = source.Element("update-key").Value;
            result.CreatedAt     = ConvertUnixTimestamp(source.Element("timestamp").Value);
            result.SocialNetwork = "LinkedIn";
            result.User          = new SocialProfileRecord
            {
                PictureUrl    = (String)profileRecord["PictureUrl"],
                ProfileUrl    = (String)profileRecord["ProfileUrl"],
                FormattedName = (String)profileRecord["FormattedName"],
                ScreenName    = (String)profileRecord["ScreenName"],
                LastName      = (String)profileRecord["LastName"]
            };
            XElement contentNode      = source.Element("update-content");
            XElement personUpdateNode = contentNode.Element("company-person-update");

            if (personUpdateNode != null)
            {
                result.PopulatePersonUpdate(personUpdateNode);
                return(result);
            }
            XElement statusUpdateNode = contentNode.Element("company-status-update");

            if (statusUpdateNode != null)
            {
                result.PopulateStatusUpdate(statusUpdateNode);
                return(result);
            }
            XElement productUpdateNode = contentNode.Element("company-product-update");

            if (productUpdateNode != null)
            {
                result.PopulateProductUpdate(productUpdateNode);
                return(result);
            }
            XElement jobUpdateNode = contentNode.Element("company-job-update");

            if (jobUpdateNode != null)
            {
                result.PopulateJobUpdate(jobUpdateNode);
                return(result);
            }
            return(null);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source">Update node</param>
 public static LinkedinCompanyShare MakeRecord(XElement source, IRecord profileRecord)
 {
     LinkedinCompanyShare result = new LinkedinCompanyShare();
     result.StatusID = source.Element("update-key").Value;
     result.CreatedAt = ConvertUnixTimestamp(source.Element("timestamp").Value);
     result.SocialNetwork = "LinkedIn";
     result.User = new SocialProfileRecord
     {
         PictureUrl = (String)profileRecord["PictureUrl"],
         ProfileUrl = (String)profileRecord["ProfileUrl"],
         FormattedName = (String)profileRecord["FormattedName"],
         ScreenName = (String)profileRecord["ScreenName"],
         LastName = (String)profileRecord["LastName"]
     };
     XElement contentNode = source.Element("update-content");
     XElement personUpdateNode = contentNode.Element("company-person-update");
     if (personUpdateNode != null)
     {
         result.PopulatePersonUpdate(personUpdateNode);
         return result;
     }
     XElement statusUpdateNode = contentNode.Element("company-status-update");
     if (statusUpdateNode != null)
     {
         result.PopulateStatusUpdate(statusUpdateNode);
         return result;
     }
     XElement productUpdateNode = contentNode.Element("company-product-update");
     if(productUpdateNode != null)
     {
         result.PopulateProductUpdate(productUpdateNode);
         return result;
     }
     XElement jobUpdateNode = contentNode.Element("company-job-update");
     if(jobUpdateNode != null)
     {
         result.PopulateJobUpdate(jobUpdateNode);
         return result;
     }
     return null;
 }