示例#1
0
        public static void OnPostTransportLimits(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];

            if (!DBNull.Value.Equals(dataRow["MaxPerDomainOutboundConnections"]))
            {
                dataRow["MaxPerDomainOutboundConnections"] = DDIUtil.ConvertUnlimitedToString <int>(dataRow["MaxPerDomainOutboundConnections"], (int t) => t.ToString());
            }
            if (!DBNull.Value.Equals(dataRow["MaxOutboundConnections"]))
            {
                dataRow["MaxOutboundConnections"] = DDIUtil.ConvertUnlimitedToString <int>(dataRow["MaxOutboundConnections"], (int t) => t.ToString());
            }
            if (!DBNull.Value.Equals(dataRow["OutboundConnectionFailureRetryInterval"]))
            {
                dataRow["OutboundConnectionFailureRetryInterval"] = ((EnhancedTimeSpan)dataRow["OutboundConnectionFailureRetryInterval"]).ToString(TimeUnit.Second, 0);
            }
            if (!DBNull.Value.Equals(dataRow["TransientFailureRetryInterval"]))
            {
                dataRow["TransientFailureRetryInterval"] = ((EnhancedTimeSpan)dataRow["TransientFailureRetryInterval"]).ToString(TimeUnit.Minute, 2);
            }
            if (!DBNull.Value.Equals(dataRow["MessageExpirationTimeout"]))
            {
                dataRow["MessageExpirationTimeout"] = ((EnhancedTimeSpan)dataRow["MessageExpirationTimeout"]).ToString(TimeUnit.Day, 9);
            }
            if (!DBNull.Value.Equals(dataRow["DelayNotificationTimeout"]))
            {
                dataRow["DelayNotificationTimeout"] = ((EnhancedTimeSpan)dataRow["DelayNotificationTimeout"]).ToString(TimeUnit.Hour, 5);
            }
        }
示例#2
0
 internal static PowerShellResults[] InsertWarningIfSucceded(PowerShellResults[] results, string warning)
 {
     if (results != null && results.Length == 1 && results[0].Succeeded)
     {
         DDIUtil.InsertWarning(results[0], warning);
     }
     return(results);
 }
示例#3
0
 public static string ZeroToUnlimited(object value)
 {
     if (value == null)
     {
         throw new ArgumentException("value");
     }
     return(DDIUtil.ZeroToUnlimited(value.ToString()));
 }
示例#4
0
 public static void GetEdgeServerPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store, PowerShellResults[] results)
 {
     inputRow["ServerRole"] = "Edge";
     ServerProperties.GetListPostAction(inputRow, dataTable, store);
     if (dataTable.Rows.Count == 0 && results != null && results.Length == 1 && results[0].Succeeded)
     {
         DDIUtil.InsertError(results[0], Strings.NoEdgeServerFound);
     }
 }
        private static string GetItemTextImp(AsyncOperationType type, AsyncOperationStatus status, object displayNameObj, object percentComplete, Func <string, string, LocalizedString> asyncProcessQueued, Func <string, string, string, LocalizedString> asyncProcessInProgressWithPercentage, Func <string, string, LocalizedString> asyncProcessInProgress, Func <string, string, LocalizedString> asyncProcessSuspended, Func <string, string, LocalizedString> asyncProcessCompleted, Func <string, string, LocalizedString> asyncProcessFailed, Func <string, string, LocalizedString> asyncProcessWaitingFinalization, Func <string, string, LocalizedString> asyncProcessCreated = null, Func <string, string, LocalizedString> asyncProcessCompleting = null, Func <string, string, LocalizedString> asyncProcessRemoving = null)
        {
            string arg    = (displayNameObj as string) ?? string.Empty;
            string result = string.Empty;
            string arg2   = DDIUtil.EnumToLocalizedString(type);

            switch (status)
            {
            case AsyncOperationStatus.Queued:
                result = asyncProcessQueued(arg2, arg);
                break;

            case AsyncOperationStatus.InProgress:
                result = ((percentComplete != DBNull.Value) ? asyncProcessInProgressWithPercentage(arg2, arg, percentComplete.ToString()) : asyncProcessInProgress(arg2, arg));
                break;

            case AsyncOperationStatus.Suspended:
                result = asyncProcessSuspended(arg2, arg);
                break;

            case AsyncOperationStatus.Completed:
                result = asyncProcessCompleted(arg2, arg);
                break;

            case AsyncOperationStatus.Failed:
                result = asyncProcessFailed(arg2, arg);
                break;

            case AsyncOperationStatus.WaitingForFinalization:
                result = asyncProcessWaitingFinalization(arg2, arg);
                break;

            case AsyncOperationStatus.Created:
                if (asyncProcessCreated != null)
                {
                    result = asyncProcessCreated(arg2, arg);
                }
                break;

            case AsyncOperationStatus.Completing:
                if (asyncProcessCompleting != null)
                {
                    result = asyncProcessCompleting(arg2, arg);
                }
                break;

            case AsyncOperationStatus.Removing:
                if (asyncProcessRemoving != null)
                {
                    result = asyncProcessRemoving(arg2, arg);
                }
                break;
            }
            return(result);
        }
示例#6
0
        public static void OnPostGlobalSettings(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];

            dataRow["MaxRecipientEnvelopeLimit"] = DDIUtil.ConvertUnlimitedToString <int>(dataRow["MaxRecipientEnvelopeLimit"], (int t) => t.ToString());
            dataRow["MaxReceiveSize"]            = DDIUtil.ConvertUnlimitedToString <ByteQuantifiedSize>(dataRow["MaxReceiveSize"], (ByteQuantifiedSize s) => s.ToMB(3));
            dataRow["MaxSendSize"] = DDIUtil.ConvertUnlimitedToString <ByteQuantifiedSize>(dataRow["MaxSendSize"], (ByteQuantifiedSize s) => s.ToMB(3));
            if (!DDIHelper.IsEmptyValue(dataRow["SafetyNetHoldTime"]))
            {
                dataRow["SafetyNetHoldTime"] = ((EnhancedTimeSpan)dataRow["SafetyNetHoldTime"]).ToString(TimeUnit.Day, 2);
            }
            if (!DDIHelper.IsEmptyValue(dataRow["MaxDumpsterTime"]))
            {
                dataRow["MaxDumpsterTime"] = ((EnhancedTimeSpan)dataRow["MaxDumpsterTime"]).ToString(TimeUnit.Day, 2);
            }
        }
        public static void GetObjectForNewPostAction(DataRow input, DataTable dataTable, DataObjectStore store)
        {
            if (dataTable.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dataTable.Rows[0];

            if (DDIUtil.IsInRole("Mailbox"))
            {
                ADObjectId executingUserId = EacRbacPrincipal.Instance.ExecutingUserId;
                dataRow["ManagedBy"] = new MultiValuedProperty <ADObjectId>(new object[]
                {
                    executingUserId
                });
            }
        }
示例#8
0
        public static void OnPreGlobalSettings(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];

            if (!DBNull.Value.Equals(dataRow["MaxReceiveSize"]))
            {
                dataRow["MaxReceiveSize"] = DDIUtil.ConvertStringToUnlimited((string)dataRow["MaxReceiveSize"], (string t) => t.FromMB());
            }
            if (!DBNull.Value.Equals(dataRow["MaxSendSize"]))
            {
                dataRow["MaxSendSize"] = DDIUtil.ConvertStringToUnlimited((string)dataRow["MaxSendSize"], (string t) => t.FromMB());
            }
            if (!DBNull.Value.Equals(dataRow["SafetyNetHoldTime"]))
            {
                dataRow["SafetyNetHoldTime"] = ((string)dataRow["SafetyNetHoldTime"]).FromTimeSpan(TimeUnit.Day).ToString();
            }
            if (!DBNull.Value.Equals(dataRow["MaxDumpsterTime"]))
            {
                dataRow["MaxDumpsterTime"] = ((string)dataRow["MaxDumpsterTime"]).FromTimeSpan(TimeUnit.Day).ToString();
            }
        }
 public static void SetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store, PowerShellResults[] results)
 {
     DDIUtil.InsertWarningIfSucceded(results, Strings.EditEAPWarning);
 }
示例#10
0
 public static string ConvertEnumToLocalizedString(object value)
 {
     return(DDIUtil.EnumToLocalizedString(((QuarantineMessageType)value).Value));
 }