private static void SetImapDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance)
 {
     ThrottlingPolicyDefaults.ImapMaxConcurrency = maxConcurrency;
     ThrottlingPolicyDefaults.ImapMaxBurst       = maxBurst;
     ThrottlingPolicyDefaults.ImapRechargeRate   = rechargeRate;
     ThrottlingPolicyDefaults.ImapCutoffBalance  = cutoffBalance;
 }
 private static void SetEasDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance, Unlimited <uint> maxDevices, Unlimited <uint> maxDeviceDeletesPerMonth, Unlimited <uint> maxInactivityForDeviceCleanup)
 {
     ThrottlingPolicyDefaults.EasMaxConcurrency                = maxConcurrency;
     ThrottlingPolicyDefaults.EasMaxBurst                      = maxBurst;
     ThrottlingPolicyDefaults.EasRechargeRate                  = rechargeRate;
     ThrottlingPolicyDefaults.EasCutoffBalance                 = cutoffBalance;
     ThrottlingPolicyDefaults.EasMaxDevices                    = maxDevices;
     ThrottlingPolicyDefaults.EasMaxDeviceDeletesPerMonth      = maxDeviceDeletesPerMonth;
     ThrottlingPolicyDefaults.EasMaxInactivityForDeviceCleanup = maxInactivityForDeviceCleanup;
 }
 private static void SetEwsDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance, Unlimited <uint> maxSubscriptions)
 {
     ThrottlingPolicyDefaults.EwsMaxConcurrency   = maxConcurrency;
     ThrottlingPolicyDefaults.EwsMaxBurst         = maxBurst;
     ThrottlingPolicyDefaults.EwsRechargeRate     = rechargeRate;
     ThrottlingPolicyDefaults.EwsCutoffBalance    = cutoffBalance;
     ThrottlingPolicyDefaults.EwsMaxSubscriptions = maxSubscriptions;
 }
 private static void SetE4eRecipientDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance)
 {
     ThrottlingPolicyDefaults.EncryptionRecipientMaxConcurrency = maxConcurrency;
     ThrottlingPolicyDefaults.EncryptionRecipientMaxBurst       = maxBurst;
     ThrottlingPolicyDefaults.EncryptionRecipientRechargeRate   = rechargeRate;
     ThrottlingPolicyDefaults.EncryptionRecipientCutoffBalance  = cutoffBalance;
 }
 private static void SetComplianceDefaults(Unlimited <uint> complianceMaxExpansionDGRecipients, Unlimited <uint> complianceMaxExpansionNestedDGs)
 {
     ThrottlingPolicyDefaults.ComplianceMaxExpansionDGRecipients = complianceMaxExpansionDGRecipients;
     ThrottlingPolicyDefaults.ComplianceMaxExpansionNestedDGs    = complianceMaxExpansionNestedDGs;
 }
 internal static MbxPropertyDefinition UnlimitedInt32FromStringPropertyDefinition(string name, MbxPropertyDefinition rawPropertyDefinition, bool multivalued = false)
 {
     return(new MbxPropertyDefinition(name, PropTag.Null, ExchangeObjectVersion.Exchange2003, typeof(Unlimited <int>), (multivalued ? PropertyDefinitionFlags.MultiValued : PropertyDefinitionFlags.None) | PropertyDefinitionFlags.Calculated, multivalued ? null : default(Unlimited <int>), PropertyDefinitionConstraint.None, PropertyDefinitionConstraint.None, new MbxPropertyDefinition[]
     {
         rawPropertyDefinition
     }, (IPropertyBag propertyBag) => (propertyBag[rawPropertyDefinition] == null) ? default(Unlimited <int>) : Unlimited <int> .Parse((string)propertyBag[rawPropertyDefinition]), delegate(object value, IPropertyBag propertyBag)
     {
         propertyBag[rawPropertyDefinition] = ((Unlimited <int>)value).ToString();
     }));
 }
Ejemplo n.º 7
0
 public bool Equals(Unlimited <T> other)
 {
     return(this.isUnlimited == other.isUnlimited && (this.isUnlimited || EqualityComparer <T> .Default.Equals(this.limitedValue, other.limitedValue)));
 }
 private static void SetPswsDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxRequest, Unlimited <uint> maxRequestTimePeriod)
 {
     ThrottlingPolicyDefaults.PswsMaxConcurrency       = maxConcurrency;
     ThrottlingPolicyDefaults.PswsMaxRequest           = maxRequest;
     ThrottlingPolicyDefaults.PswsMaxRequestTimePeriod = maxRequestTimePeriod;
 }
 private static void SetGeneralDefaults(Unlimited <uint> messageRateLimit, Unlimited <uint> recipientRateLimit, Unlimited <uint> forwardeeLimit)
 {
     ThrottlingPolicyDefaults.MessageRateLimit   = messageRateLimit;
     ThrottlingPolicyDefaults.RecipientRateLimit = recipientRateLimit;
     ThrottlingPolicyDefaults.ForwardeeLimit     = forwardeeLimit;
 }
 private ThrottlingPolicyEasSettings(string value) : base(value)
 {
     Unlimited <uint>?maxDevices = this.MaxDevices;
     Unlimited <uint>?maxDeviceDeletesPerMonth      = this.MaxDeviceDeletesPerMonth;
     Unlimited <uint>?maxInactivityForDeviceCleanup = this.MaxInactivityForDeviceCleanup;
 }
 private static void SetPowerShellDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxTenantConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance, Unlimited <uint> maxOperations, Unlimited <uint> maxCmdletsTimePeriod, Unlimited <uint> exchangeMaxCmdlets, Unlimited <uint> maxCmdletQueueDepth, Unlimited <uint> maxDestructiveCmdlets, Unlimited <uint> maxDestructiveCmdletsTimePeriod, Unlimited <uint> maxCmdlets, Unlimited <uint> maxRunspaces, Unlimited <uint> maxTenantRunspaces, Unlimited <uint> maxRunspacesTimePeriod)
 {
     ThrottlingPolicyDefaults.PowerShellMaxConcurrency                  = maxConcurrency;
     ThrottlingPolicyDefaults.PowerShellMaxTenantConcurrency            = maxTenantConcurrency;
     ThrottlingPolicyDefaults.PowerShellMaxBurst                        = maxBurst;
     ThrottlingPolicyDefaults.PowerShellRechargeRate                    = rechargeRate;
     ThrottlingPolicyDefaults.PowerShellCutoffBalance                   = cutoffBalance;
     ThrottlingPolicyDefaults.PowerShellMaxOperations                   = maxOperations;
     ThrottlingPolicyDefaults.PowerShellMaxCmdletsTimePeriod            = maxCmdletsTimePeriod;
     ThrottlingPolicyDefaults.ExchangeMaxCmdlets                        = exchangeMaxCmdlets;
     ThrottlingPolicyDefaults.PowerShellMaxCmdletQueueDepth             = maxCmdletQueueDepth;
     ThrottlingPolicyDefaults.PowerShellMaxDestructiveCmdlets           = maxDestructiveCmdlets;
     ThrottlingPolicyDefaults.PowerShellMaxDestructiveCmdletsTimePeriod = maxDestructiveCmdletsTimePeriod;
     ThrottlingPolicyDefaults.PowerShellMaxCmdlets                      = maxCmdlets;
     ThrottlingPolicyDefaults.PowerShellMaxRunspaces                    = maxRunspaces;
     ThrottlingPolicyDefaults.PowerShellMaxTenantRunspaces              = maxTenantRunspaces;
     ThrottlingPolicyDefaults.PowerShellMaxRunspacesTimePeriod          = maxRunspacesTimePeriod;
 }
Ejemplo n.º 12
0
 private static T DynamicResolveOperation(Unlimited <T> value1, object value2, string operationName)
 {
     Type[] genericTypeArguments = value1.GetType().GetTypeInfo().GenericTypeArguments;
     if (genericTypeArguments[0] == typeof(int))
     {
         int?num  = value1.Value as int?;
         int?num2 = value2 as int?;
         if (num2 == null)
         {
             num2 = new int?((int)Convert.ChangeType(value2, typeof(int)));
         }
         if (num2 == null)
         {
             throw new InvalidOperationException(DataStrings.ExceptionCannotResolveOperation(operationName, typeof(T).Name, value2.GetType().Name));
         }
         if ("op_Subtraction".Equals(operationName))
         {
             return((T)((object)(num.Value - num2.Value)));
         }
         if ("op_Division".Equals(operationName))
         {
             return((T)((object)(num.Value / num2.Value)));
         }
         if ("op_Multiply".Equals(operationName))
         {
             return((T)((object)(num.Value * num2.Value)));
         }
         return((T)((object)(num.Value + num2.Value)));
     }
     else if (genericTypeArguments[0] == typeof(uint))
     {
         uint?num3 = value1.Value as uint?;
         uint?num4 = value2 as uint?;
         if (num4 == null)
         {
             num4 = new uint?((uint)Convert.ChangeType(value2, typeof(uint)));
         }
         if (num4 == null)
         {
             throw new InvalidOperationException(DataStrings.ExceptionCannotResolveOperation(operationName, typeof(T).Name, value2.GetType().Name));
         }
         if ("op_Subtraction".Equals(operationName))
         {
             return((T)((object)(num3.Value - num4.Value)));
         }
         if ("op_Division".Equals(operationName))
         {
             return((T)((object)(num3.Value / num4.Value)));
         }
         if ("op_Multiply".Equals(operationName))
         {
             return((T)((object)(num3.Value * num4.Value)));
         }
         return((T)((object)(num3.Value + num4.Value)));
     }
     else
     {
         MethodInfo methodInfo = null;
         foreach (MethodInfo methodInfo2 in from x in genericTypeArguments[0].GetTypeInfo().DeclaredMethods
                  where x.Name == operationName
                  select x)
         {
             ParameterInfo[] parameters = methodInfo2.GetParameters();
             if (parameters.Length == 2 && parameters[0].ParameterType == genericTypeArguments[0] && parameters[1].ParameterType == value2.GetType())
             {
                 methodInfo = methodInfo2;
                 break;
             }
         }
         if (methodInfo == null)
         {
             throw new InvalidOperationException(DataStrings.ExceptionCannotResolveOperation(operationName, typeof(T).Name, value2.GetType().Name));
         }
         object[] parameters2 = new object[]
         {
             value1.Value,
             value2
         };
         T result;
         try
         {
             result = (T)((object)methodInfo.Invoke(value1.Value, parameters2));
         }
         catch (TargetInvocationException ex)
         {
             throw ex.InnerException;
         }
         return(result);
     }
 }
Ejemplo n.º 13
0
 public static Unlimited <T> operator -(Unlimited <T> value1, object value2)
 {
     return(Unlimited <T> .ExecDynamicOperation(value1, value2, "op_Subtraction"));
 }
Ejemplo n.º 14
0
 public static Unlimited <T> operator *(Unlimited <T> value1, object value2)
 {
     return(Unlimited <T> .ExecDynamicOperation(value1, value2, "op_Multiply"));
 }
 private static void SetOutlookServiceDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance, Unlimited <uint> maxSubscriptions, Unlimited <uint> maxSocketConnectionsPerDevice, Unlimited <uint> maxSocketConnectionsPerUser)
 {
     ThrottlingPolicyDefaults.OutlookServiceMaxConcurrency   = maxConcurrency;
     ThrottlingPolicyDefaults.OutlookServiceMaxBurst         = maxBurst;
     ThrottlingPolicyDefaults.OutlookServiceRechargeRate     = rechargeRate;
     ThrottlingPolicyDefaults.OutlookServiceCutoffBalance    = cutoffBalance;
     ThrottlingPolicyDefaults.OutlookServiceMaxSubscriptions = maxSubscriptions;
     ThrottlingPolicyDefaults.OutlookServiceMaxSocketConnectionsPerDevice = maxSocketConnectionsPerDevice;
     ThrottlingPolicyDefaults.OutlookServiceMaxSocketConnectionsPerUser   = maxSocketConnectionsPerUser;
 }
 private static void SetDiscoveryDefaults(Unlimited <uint> discoveryMaxConcurrency, Unlimited <uint> discoveryMaxMailboxes, Unlimited <uint> discoveryMaxKeywords, Unlimited <uint> discoveryMaxPreviewSearchMailboxes, Unlimited <uint> discoveryMaxStatsSearchMailboxes, Unlimited <uint> discoveryPreviewSearchResultsPageSize, Unlimited <uint> discoveryMaxKeywordsPerPage, Unlimited <uint> discoveryMaxRefinerResults, Unlimited <uint> discoveryMaxSearchQueueDepth, Unlimited <uint> discoverySearchTimeoutPeriod)
 {
     ThrottlingPolicyDefaults.DiscoveryMaxConcurrency               = discoveryMaxConcurrency;
     ThrottlingPolicyDefaults.DiscoveryMaxMailboxes                 = discoveryMaxMailboxes;
     ThrottlingPolicyDefaults.DiscoveryMaxKeywords                  = discoveryMaxKeywords;
     ThrottlingPolicyDefaults.DiscoveryMaxPreviewSearchMailboxes    = discoveryMaxPreviewSearchMailboxes;
     ThrottlingPolicyDefaults.DiscoveryMaxStatsSearchMailboxes      = discoveryMaxStatsSearchMailboxes;
     ThrottlingPolicyDefaults.DiscoveryPreviewSearchResultsPageSize = discoveryPreviewSearchResultsPageSize;
     ThrottlingPolicyDefaults.DiscoveryMaxKeywordsPerPage           = discoveryMaxKeywordsPerPage;
     ThrottlingPolicyDefaults.DiscoveryMaxRefinerResults            = discoveryMaxRefinerResults;
     ThrottlingPolicyDefaults.DiscoveryMaxSearchQueueDepth          = discoveryMaxSearchQueueDepth;
     ThrottlingPolicyDefaults.DiscoverySearchTimeoutPeriod          = discoverySearchTimeoutPeriod;
 }
 private static void SetOwaDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance, Unlimited <uint> voiceMaxConcurrency, Unlimited <uint> voiceMaxBurst, Unlimited <uint> voiceRechargeRate, Unlimited <uint> voiceCutoffBalance)
 {
     ThrottlingPolicyDefaults.OwaMaxConcurrency      = maxConcurrency;
     ThrottlingPolicyDefaults.OwaMaxBurst            = maxBurst;
     ThrottlingPolicyDefaults.OwaRechargeRate        = rechargeRate;
     ThrottlingPolicyDefaults.OwaCutoffBalance       = cutoffBalance;
     ThrottlingPolicyDefaults.OwaVoiceMaxConcurrency = voiceMaxConcurrency;
     ThrottlingPolicyDefaults.OwaVoiceMaxBurst       = voiceMaxBurst;
     ThrottlingPolicyDefaults.OwaVoiceRechargeRate   = voiceRechargeRate;
     ThrottlingPolicyDefaults.OwaVoiceCutoffBalance  = voiceCutoffBalance;
 }
 private static void SetPushNotificationDefaults(Unlimited <uint> maxConcurrency, Unlimited <uint> maxBurst, Unlimited <uint> rechargeRate, Unlimited <uint> cutoffBalance, Unlimited <uint> maxBurstPerDevice, Unlimited <uint> rechargeRatePerDevice, Unlimited <uint> samplingPeriodPerDevice)
 {
     ThrottlingPolicyDefaults.PushNotificationMaxConcurrency          = maxConcurrency;
     ThrottlingPolicyDefaults.PushNotificationMaxBurst                = maxBurst;
     ThrottlingPolicyDefaults.PushNotificationRechargeRate            = rechargeRate;
     ThrottlingPolicyDefaults.PushNotificationCutoffBalance           = cutoffBalance;
     ThrottlingPolicyDefaults.PushNotificationMaxBurstPerDevice       = maxBurstPerDevice;
     ThrottlingPolicyDefaults.PushNotificationRechargeRatePerDevice   = rechargeRatePerDevice;
     ThrottlingPolicyDefaults.PushNotificationSamplingPeriodPerDevice = samplingPeriodPerDevice;
 }
Ejemplo n.º 19
0
 private ThrottlingPolicyPushNotificationSettings(string value) : base(value)
 {
     Unlimited <uint>?pushNotificationMaxBurstPerDevice       = this.PushNotificationMaxBurstPerDevice;
     Unlimited <uint>?pushNotificationRechargeRatePerDevice   = this.PushNotificationRechargeRatePerDevice;
     Unlimited <uint>?pushNotificationSamplingPeriodPerDevice = this.PushNotificationSamplingPeriodPerDevice;
 }
Ejemplo n.º 20
0
        public static bool TryParse(string expression, ByteQuantifiedSize.Quantifier defaultUnit, out Unlimited <ByteQuantifiedSize> result)
        {
            bool result2 = false;

            result = Unlimited <ByteQuantifiedSize> .UnlimitedValue;
            if (StringComparer.OrdinalIgnoreCase.Compare(expression, "Unlimited") == 0)
            {
                return(true);
            }
            ByteQuantifiedSize fromValue;

            if (ByteQuantifiedSize.TryParse(expression, defaultUnit, out fromValue))
            {
                result = fromValue;
            }
            return(result2);
        }