Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (id_ != null)
            {
                hash ^= Id.GetHashCode();
            }
            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (MimeType != 0)
            {
                hash ^= MimeType.GetHashCode();
            }
            if (sourceUrl_ != null)
            {
                hash ^= SourceUrl.GetHashCode();
            }
            if (name_ != null)
            {
                hash ^= Name.GetHashCode();
            }
            if (fileSize_ != null)
            {
                hash ^= FileSize.GetHashCode();
            }
            if (mediatypeCase_ == MediatypeOneofCase.Image)
            {
                hash ^= Image.GetHashCode();
            }
            if (mediatypeCase_ == MediatypeOneofCase.MediaBundle)
            {
                hash ^= MediaBundle.GetHashCode();
            }
            hash ^= (int)mediatypeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 2
0
        public void MergeFrom(MediaFile other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.id_ != null)
            {
                if (id_ == null || other.Id != 0L)
                {
                    Id = other.Id;
                }
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            if (other.MimeType != 0)
            {
                MimeType = other.MimeType;
            }
            if (other.sourceUrl_ != null)
            {
                if (sourceUrl_ == null || other.SourceUrl != "")
                {
                    SourceUrl = other.SourceUrl;
                }
            }
            if (other.name_ != null)
            {
                if (name_ == null || other.Name != "")
                {
                    Name = other.Name;
                }
            }
            if (other.fileSize_ != null)
            {
                if (fileSize_ == null || other.FileSize != 0L)
                {
                    FileSize = other.FileSize;
                }
            }
            switch (other.MediatypeCase)
            {
            case MediatypeOneofCase.Image:
                if (Image == null)
                {
                    Image = new global::Google.Ads.GoogleAds.V0.Resources.MediaImage();
                }
                Image.MergeFrom(other.Image);
                break;

            case MediatypeOneofCase.MediaBundle:
                if (MediaBundle == null)
                {
                    MediaBundle = new global::Google.Ads.GoogleAds.V0.Resources.MediaBundle();
                }
                MediaBundle.MergeFrom(other.MediaBundle);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }