示例#1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (BaseURI != null)
         {
             hashCode = hashCode * 59 + BaseURI.GetHashCode();
         }
         if (ContentDomain != null)
         {
             hashCode = hashCode * 59 + ContentDomain.GetHashCode();
         }
         if (SdcSchemaVersion != null)
         {
             hashCode = hashCode * 59 + SdcSchemaVersion.GetHashCode();
         }
         if (PkgLineage != null)
         {
             hashCode = hashCode * 59 + PkgLineage.GetHashCode();
         }
         if (Version != null)
         {
             hashCode = hashCode * 59 + Version.GetHashCode();
         }
         if (Offset != null)
         {
             hashCode = hashCode * 59 + Offset.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        private string GetPathRelativeToBucket(Uri uri)
        {
            if (uri == null)
            {
                throw new ArgumentNullException(nameof(uri));
            }

            string baseUri = BaseURI.ToString();
            string path    = uri.AbsoluteUri;

            if (!path.StartsWith(baseUri, StringComparison.Ordinal))
            {
                throw new InvalidOperationException($"Unable to make '{uri.AbsoluteUri}' relative to '{baseUri}'");
            }

            string key = path.Replace(baseUri, string.Empty);

            if (!string.IsNullOrEmpty(FeedSubPath))
            {
                key = FeedSubPath[FeedSubPath.Length - 1] == '/'
                    ? FeedSubPath + key
                    : FeedSubPath + "/" + key;
            }

            return(key);
        }
示例#3
0
 public SenderModule(BaseURI baseUri, IAdminMailModule adminMailModule, IMailListModule mailListModule,
                     IMemberModule memberModule, ICampaignModule campaignModule, IContentModule contentModule)
 {
     _adminMailModule = adminMailModule;
     _mailListModule  = mailListModule;
     _memberModule    = memberModule;
     _campaignModule  = campaignModule;
     _contentModule   = contentModule;
     _baseUri         = baseUri;
 }
示例#4
0
        public void Configure(Settings settings)
        {
            Protocol   protocol = settings.protocol != null ? settings.protocol.Value : Protocol.HTTP;
            UriBuilder builder  = new UriBuilder(protocol.ToString().ToLower(), settings.hostName);

            if (settings.port != null)
            {
                builder.Port = settings.port.Value;
            }
            BaseURI = builder.Uri;
            Log("Configured", settings.ToString() + " - " + BaseURI.ToString());
        }
示例#5
0
        /// <summary>
        /// Returns true if SDCFormPackageMetaData instances are equal
        /// </summary>
        /// <param name="other">Instance of SDCFormPackageMetaData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SDCFormPackageMetaData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BaseURI == other.BaseURI ||
                     BaseURI != null &&
                     BaseURI.Equals(other.BaseURI)
                     ) &&
                 (
                     ContentDomain == other.ContentDomain ||
                     ContentDomain != null &&
                     ContentDomain.Equals(other.ContentDomain)
                 ) &&
                 (
                     FormManagerURI == other.FormManagerURI ||
                     FormManagerURI != null &&
                     FormManagerURI.Equals(other.FormManagerURI)
                 ) &&
                 (
                     SdcSchemaVersion == other.SdcSchemaVersion ||
                     SdcSchemaVersion != null &&
                     SdcSchemaVersion.Equals(other.SdcSchemaVersion)
                 ) &&
                 (
                     PkgLineage == other.PkgLineage ||
                     PkgLineage != null &&
                     PkgLineage.Equals(other.PkgLineage)
                 ) &&
                 (
                     Version == other.Version ||
                     Version != null &&
                     Version.SequenceEqual(other.Version)
                 ) &&
                 (
                     Format == other.Format ||
                     Format != null &&
                     Format.Equals(other.Format)
                 ));
        }
示例#6
0
 public CampaignModule(BaseURI baseUri)
 {
     _baseUri = baseUri;
 }
示例#7
0
 public MailListModule(BaseURI baseUri)
 {
     _baseUri = baseUri;
 }
示例#8
0
 public ContentModule(BaseURI baseUri)
 {
     _baseUri = baseUri;
 }
示例#9
0
 public MemberModule(BaseURI baseUri)
 {
     _baseUri = baseUri;
 }
示例#10
0
 public AdminMailModule(BaseURI baseUri)
 {
     _baseUri = baseUri;
 }
示例#11
0
 public CustomFieldModule(BaseURI baseUri)
 {
     _baseUri = baseUri;
 }