/// <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 (PoolSize != null)
         {
             hashCode = hashCode * 59 + PoolSize.GetHashCode();
         }
         if (MaxPoolSize != null)
         {
             hashCode = hashCode * 59 + MaxPoolSize.GetHashCode();
         }
         if (QueueSize != null)
         {
             hashCode = hashCode * 59 + QueueSize.GetHashCode();
         }
         if (KeepAliveTime != null)
         {
             hashCode = hashCode * 59 + KeepAliveTime.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if ComAdobeCqSocialUgcbaseImplAysncReverseReplicatorImplProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComAdobeCqSocialUgcbaseImplAysncReverseReplicatorImplProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComAdobeCqSocialUgcbaseImplAysncReverseReplicatorImplProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PoolSize == other.PoolSize ||
                     PoolSize != null &&
                     PoolSize.Equals(other.PoolSize)
                     ) &&
                 (
                     MaxPoolSize == other.MaxPoolSize ||
                     MaxPoolSize != null &&
                     MaxPoolSize.Equals(other.MaxPoolSize)
                 ) &&
                 (
                     QueueSize == other.QueueSize ||
                     QueueSize != null &&
                     QueueSize.Equals(other.QueueSize)
                 ) &&
                 (
                     KeepAliveTime == other.KeepAliveTime ||
                     KeepAliveTime != null &&
                     KeepAliveTime.Equals(other.KeepAliveTime)
                 ));
        }
示例#3
0
        /// <summary>
        /// Returns true if ComAdobeCqSocialTranslationImplUGCLanguageDetectorProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComAdobeCqSocialTranslationImplUGCLanguageDetectorProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComAdobeCqSocialTranslationImplUGCLanguageDetectorProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EventTopics == other.EventTopics ||
                     EventTopics != null &&
                     EventTopics.Equals(other.EventTopics)
                     ) &&
                 (
                     EventFilter == other.EventFilter ||
                     EventFilter != null &&
                     EventFilter.Equals(other.EventFilter)
                 ) &&
                 (
                     TranslateListenerType == other.TranslateListenerType ||
                     TranslateListenerType != null &&
                     TranslateListenerType.Equals(other.TranslateListenerType)
                 ) &&
                 (
                     TranslatePropertyList == other.TranslatePropertyList ||
                     TranslatePropertyList != null &&
                     TranslatePropertyList.Equals(other.TranslatePropertyList)
                 ) &&
                 (
                     PoolSize == other.PoolSize ||
                     PoolSize != null &&
                     PoolSize.Equals(other.PoolSize)
                 ) &&
                 (
                     MaxPoolSize == other.MaxPoolSize ||
                     MaxPoolSize != null &&
                     MaxPoolSize.Equals(other.MaxPoolSize)
                 ) &&
                 (
                     QueueSize == other.QueueSize ||
                     QueueSize != null &&
                     QueueSize.Equals(other.QueueSize)
                 ) &&
                 (
                     KeepAliveTime == other.KeepAliveTime ||
                     KeepAliveTime != null &&
                     KeepAliveTime.Equals(other.KeepAliveTime)
                 ));
        }
示例#4
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 (JdbcDriverClass != null)
         {
             hashCode = hashCode * 59 + JdbcDriverClass.GetHashCode();
         }
         if (JdbcConnectionUri != null)
         {
             hashCode = hashCode * 59 + JdbcConnectionUri.GetHashCode();
         }
         if (JdbcUsername != null)
         {
             hashCode = hashCode * 59 + JdbcUsername.GetHashCode();
         }
         if (JdbcPassword != null)
         {
             hashCode = hashCode * 59 + JdbcPassword.GetHashCode();
         }
         if (JdbcValidationQuery != null)
         {
             hashCode = hashCode * 59 + JdbcValidationQuery.GetHashCode();
         }
         if (DefaultReadonly != null)
         {
             hashCode = hashCode * 59 + DefaultReadonly.GetHashCode();
         }
         if (DefaultAutocommit != null)
         {
             hashCode = hashCode * 59 + DefaultAutocommit.GetHashCode();
         }
         if (PoolSize != null)
         {
             hashCode = hashCode * 59 + PoolSize.GetHashCode();
         }
         if (PoolMaxWaitMsec != null)
         {
             hashCode = hashCode * 59 + PoolMaxWaitMsec.GetHashCode();
         }
         if (DatasourceName != null)
         {
             hashCode = hashCode * 59 + DatasourceName.GetHashCode();
         }
         if (DatasourceSvcProperties != null)
         {
             hashCode = hashCode * 59 + DatasourceSvcProperties.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#5
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 (EventTopics != null)
         {
             hashCode = hashCode * 59 + EventTopics.GetHashCode();
         }
         if (EventFilter != null)
         {
             hashCode = hashCode * 59 + EventFilter.GetHashCode();
         }
         if (TranslateListenerType != null)
         {
             hashCode = hashCode * 59 + TranslateListenerType.GetHashCode();
         }
         if (TranslatePropertyList != null)
         {
             hashCode = hashCode * 59 + TranslatePropertyList.GetHashCode();
         }
         if (PoolSize != null)
         {
             hashCode = hashCode * 59 + PoolSize.GetHashCode();
         }
         if (MaxPoolSize != null)
         {
             hashCode = hashCode * 59 + MaxPoolSize.GetHashCode();
         }
         if (QueueSize != null)
         {
             hashCode = hashCode * 59 + QueueSize.GetHashCode();
         }
         if (KeepAliveTime != null)
         {
             hashCode = hashCode * 59 + KeepAliveTime.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#6
0
        public Sound LoadSound(string soundName)
        {
            SoundBuffer sb;

            if (_soundBufferPool.TryGetValue(soundName, out sb))
            {
                return(new Sound(sb));
            }
            if (_soundBufferPool.Count > PoolSize)
            {
                PoolSize += PoolSizeAutoIncrementSize;
            }
            if (PoolSize > PoolSizeHardLimit)
            {
                PoolSize = PoolSize.Clamp <uint>(0, PoolSizeHardLimit);
                throw new OverflowException("Pool-Size: " + PoolSize + " exceeded Hard Limit: " + PoolSizeHardLimit);
            }
            sb = new SoundBuffer(soundName);
            _soundBufferPool.Add(soundName, sb);
            return(new Sound(sb));
        }
        public Texture LoadTexture(string textureName, IntRect textureArea)
        {
            Texture t;

            if (_texturePool.TryGetValue(textureName, out t))
            {
                return(t);
            }
            if (_texturePool.Count > PoolSize)
            {
                PoolSize += PoolSizeAutoIncrementSize;
            }
            if (PoolSize > PoolSizeHardLimit)
            {
                PoolSize = PoolSize.Clamp <uint>(0, PoolSizeHardLimit);
                throw new OverflowException("Pool-Size: " + PoolSize + " exceeded Hard Limit: " + PoolSizeHardLimit);
            }
            t = new Texture(textureName);
            _texturePool.Add(textureName, t);
            return(t);
        }
示例#8
0
        private static byte getXPoolSize(string dbName, PoolSize x)
        {
            string pSz;
            byte xPSz;

            if ((pSz = RegistryUtility.GetRegistryValueAsString(Registry.LocalMachine, "Software\\SharedDB\\Database\\" + dbName, x.ToString() + " Connections", false)) == null) {
                if ((pSz = RegistryUtility.GetRegistryValueAsString(Registry.LocalMachine, "Software\\SharedDB\\Database", x.ToString() + " Connections", false)) == null) {
                    //for better program flow just convert this to string for now
                    pSz = x == PoolSize.Max ? System.Convert.ToString(MAX_POOL_SIZE) : System.Convert.ToString(MIN_POOL_SIZE);
                }
            }

            try {
                xPSz = System.Convert.ToByte(pSz);
            } catch (System.OverflowException) {
                throw new Exception("Database " + dbName + " " + x.ToString() + " Pool size is of \"" + pSz + "\" is out of range.");
            } catch (System.FormatException) {
                throw new Exception("Database " + dbName + " " + x.ToString() + " Pool size is of \"" + pSz + "\" is not valid.");
            }

            return xPSz;
        }
示例#9
0
        /// <summary>
        /// Returns true if ComDayCommonsDatasourceJdbcpoolJdbcPoolServiceProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComDayCommonsDatasourceJdbcpoolJdbcPoolServiceProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComDayCommonsDatasourceJdbcpoolJdbcPoolServiceProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     JdbcDriverClass == other.JdbcDriverClass ||
                     JdbcDriverClass != null &&
                     JdbcDriverClass.Equals(other.JdbcDriverClass)
                     ) &&
                 (
                     JdbcConnectionUri == other.JdbcConnectionUri ||
                     JdbcConnectionUri != null &&
                     JdbcConnectionUri.Equals(other.JdbcConnectionUri)
                 ) &&
                 (
                     JdbcUsername == other.JdbcUsername ||
                     JdbcUsername != null &&
                     JdbcUsername.Equals(other.JdbcUsername)
                 ) &&
                 (
                     JdbcPassword == other.JdbcPassword ||
                     JdbcPassword != null &&
                     JdbcPassword.Equals(other.JdbcPassword)
                 ) &&
                 (
                     JdbcValidationQuery == other.JdbcValidationQuery ||
                     JdbcValidationQuery != null &&
                     JdbcValidationQuery.Equals(other.JdbcValidationQuery)
                 ) &&
                 (
                     DefaultReadonly == other.DefaultReadonly ||
                     DefaultReadonly != null &&
                     DefaultReadonly.Equals(other.DefaultReadonly)
                 ) &&
                 (
                     DefaultAutocommit == other.DefaultAutocommit ||
                     DefaultAutocommit != null &&
                     DefaultAutocommit.Equals(other.DefaultAutocommit)
                 ) &&
                 (
                     PoolSize == other.PoolSize ||
                     PoolSize != null &&
                     PoolSize.Equals(other.PoolSize)
                 ) &&
                 (
                     PoolMaxWaitMsec == other.PoolMaxWaitMsec ||
                     PoolMaxWaitMsec != null &&
                     PoolMaxWaitMsec.Equals(other.PoolMaxWaitMsec)
                 ) &&
                 (
                     DatasourceName == other.DatasourceName ||
                     DatasourceName != null &&
                     DatasourceName.Equals(other.DatasourceName)
                 ) &&
                 (
                     DatasourceSvcProperties == other.DatasourceSvcProperties ||
                     DatasourceSvcProperties != null &&
                     DatasourceSvcProperties.Equals(other.DatasourceSvcProperties)
                 ));
        }