Ejemplo n.º 1
0
        /// <summary>
        /// Determines the contact type (known, semi-known or anonymous) then parses and persists the captured data
        /// </summary>
        /// <param name='htmlMatch'>
        /// Matched html
        /// </param>
        /// <param name='semiKnownID'>
        /// This represents the primary key of a semi-known viewer of your profile.  It will only be populated if the viewer is semi-known, otherwise
        /// it will be null
        /// </param>
        private void DetermineParse(string htmlMatch, int?semiKnownID)
        {
            _logger.AddLogMessage("Parsing contact...");

            try
            {
                var tp = TagFactory.GetTagParser(htmlMatch, _logger, semiKnownID);
                tp.SaveTagContents();

                var semiKnownTagParser = tp as SemiKnownTagParser;

                if (semiKnownTagParser != null)
                {
                    Post(semiKnownTagParser.MainEntryID, semiKnownTagParser.SemiKnownURL);
                }

                Console.WriteLine(tp);
            }
            catch (Exception ex)
            {
                _logger.AddLogMessage(ex);

                throw;
            }

            _logger.AddLogMessage("Parsing contact complete...");
        }