Ejemplo n.º 1
0
 public void MergeFrom(EmbedInfo other)
 {
     if (other == null)
     {
         return;
     }
     if (other.HasTitle)
     {
         Title = other.Title;
     }
     if (other.HasType)
     {
         Type = other.Type;
     }
     if (other.HasOriginalUrl)
     {
         OriginalUrl = other.OriginalUrl;
     }
     if (other.HasThumbnail)
     {
         if (!HasThumbnail)
         {
             Thumbnail = new global::Bgs.Protocol.EmbedImage();
         }
         Thumbnail.MergeFrom(other.Thumbnail);
     }
     if (other.HasProvider)
     {
         if (!HasProvider)
         {
             Provider = new global::Bgs.Protocol.Provider();
         }
         Provider.MergeFrom(other.Provider);
     }
     if (other.HasDescription)
     {
         Description = other.Description;
     }
     if (other.HasFavicon)
     {
         if (!HasFavicon)
         {
             Favicon = new global::Bgs.Protocol.Favicon();
         }
         Favicon.MergeFrom(other.Favicon);
     }
     if (other.HasHtml)
     {
         if (!HasHtml)
         {
             Html = new global::Bgs.Protocol.EmbedHTML();
         }
         Html.MergeFrom(other.Html);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (HasTitle)
            {
                hash ^= Title.GetHashCode();
            }
            if (HasType)
            {
                hash ^= Type.GetHashCode();
            }
            if (HasOriginalUrl)
            {
                hash ^= OriginalUrl.GetHashCode();
            }
            if (HasThumbnail)
            {
                hash ^= Thumbnail.GetHashCode();
            }
            if (HasProvider)
            {
                hash ^= Provider.GetHashCode();
            }
            if (HasDescription)
            {
                hash ^= Description.GetHashCode();
            }
            if (HasFavicon)
            {
                hash ^= Favicon.GetHashCode();
            }
            if (HasHtml)
            {
                hash ^= Html.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }