Example #1
0
        public static string GetAudioQualityIconAndAlternateText(float?nmos, out string alternateText)
        {
            float?num  = nmos;
            float num2 = (num != null) ? num.GetValueOrDefault() : AudioQuality.UnknownValue;

            switch (AudioQuality.GetQualityOfAudio(num2))
            {
            case 0:
                alternateText = Strings.UMAudioQualityExcellent;
                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.AudioQualityFiveBars));

            case 1:
                alternateText = Strings.UMAudioQualityGood;
                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.AudioQualityFourBars));

            case 2:
                alternateText = Strings.UMAudioQualityAverage;
                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.AudioQualityThreeBars));

            case 3:
                alternateText = Strings.UMAudioQualityPoor;
                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.AudioQualityTwoBars));

            case 4:
                alternateText = Strings.UMAudioQualityBad;
                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.AudioQualityOneBar));
            }
            alternateText = Strings.UMAudioQualityNotAvailable;
            return(CommandSprite.GetCssClass(CommandSprite.SpriteId.AudioQualityNotAvailable));
        }
Example #2
0
 private void Initialize(bool isEnabled, bool canEnable)
 {
     base.UseModalDialogForEdit = false;
     base.Name        = Strings.UMMailboxFeatureName;
     this.IconAltText = Strings.UMAltText;
     this.SpriteId    = CommandSprite.GetCssClass(CommandSprite.SpriteId.UMMailboxFeature);
     base.EnableWizardDialogHeight = new int?(574);
     base.EnableWizardDialogWidth  = new int?(600);
     base.PropertiesDialogHeight   = new int?(PopupCommand.DefaultBookmarkedPopupHeight);
     base.PropertiesDialogWidth    = new int?(PopupCommand.DefaultBookmarkedPopupWidth);
     if (base.Identity != null)
     {
         this.Status           = (isEnabled ? ClientStrings.EnabledDisplayText : ClientStrings.DisabledDisplayText);
         base.EnableCommandUrl = "EnableUMMailbox.aspx";
         if (!isEnabled && canEnable && base.IsInRole(UMMailboxFeatureInfo.enableRoles))
         {
             this.CanChangeStatus = true;
         }
         if (isEnabled)
         {
             if (base.IsInRole(UMMailboxFeatureInfo.disableRoles))
             {
                 this.CanChangeStatus = true;
             }
             if (base.IsInRole(UMMailboxFeatureInfo.editRoles))
             {
                 base.EditCommandUrl = "EditUMMailbox.aspx?id=" + HttpUtility.UrlEncode(base.Identity.RawIdentity);
             }
         }
     }
 }
Example #3
0
 public LitigationHoldFeatureInfo(Mailbox mailbox) : base(mailbox)
 {
     base.UseModalDialogForEdit   = true;
     base.UseModalDialogForEnable = true;
     base.Name = Strings.LitigationHoldFeatureName;
     base.EnableWizardDialogHeight = new int?(450);
     base.EnableWizardDialogWidth  = new int?(510);
     base.PropertiesDialogHeight   = new int?(450);
     base.PropertiesDialogWidth    = new int?(510);
     this.IconAltText = Strings.MailboxAltText;
     this.SpriteId    = CommandSprite.GetCssClass(CommandSprite.SpriteId.Mailbox16);
     if (mailbox != null)
     {
         this.Caption = mailbox.DisplayName;
         bool litigationHoldEnabled = mailbox.LitigationHoldEnabled;
         this.Status = (litigationHoldEnabled ? ClientStrings.EnabledDisplayText : ClientStrings.DisabledDisplayText);
         if (base.IsInRole(LitigationHoldFeatureInfo.enableRoles) && !litigationHoldEnabled)
         {
             this.CanChangeStatus  = true;
             base.EnableCommandUrl = "EditLitigationHold.aspx";
         }
         if (base.IsInRole(LitigationHoldFeatureInfo.editRoles) && litigationHoldEnabled)
         {
             base.EditCommandUrl = "EditLitigationHold.aspx";
         }
         if (base.IsInRole(LitigationHoldFeatureInfo.disableRoles) && litigationHoldEnabled)
         {
             this.CanChangeStatus = true;
         }
         this.RetentionComment = mailbox.RetentionComment;
         this.RetentionUrl     = mailbox.RetentionUrl;
         if (mailbox.LitigationHoldDate != null)
         {
             this.LitigationHoldDate = mailbox.LitigationHoldDate.Value.ToUniversalTime().UtcToUserDateTimeString();
         }
         else
         {
             this.LitigationHoldDate = Strings.LitigationHoldDateNotSet;
         }
         if (!string.IsNullOrEmpty(mailbox.LitigationHoldOwner))
         {
             this.LitigationHoldOwner = mailbox.LitigationHoldOwner;
         }
         else
         {
             this.LitigationHoldOwner = Strings.LitigationHoldOwnerNotSet;
         }
     }
     if (!base.IsReadOnly && mailbox.ExchangeVersion.IsOlderThan(ExchangeObjectVersion.Exchange2010))
     {
         base.ShowReadOnly    = true;
         this.CanChangeStatus = false;
         base.EditCommandUrl  = null;
     }
 }
Example #4
0
        public static string FromEnum(SecurityPrincipalType securityPrincipalType)
        {
            string result = string.Empty;

            switch (securityPrincipalType)
            {
            case SecurityPrincipalType.User:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.Mailbox16);
                break;

            case SecurityPrincipalType.Group:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.DistributionGroup16);
                break;
            }
            return(result);
        }
        internal static string FromEnum(SearchState status)
        {
            string result = string.Empty;

            switch (status)
            {
            case SearchState.InProgress:
            case SearchState.EstimateInProgress:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.MailboxSearchInProgress);
                break;

            case SearchState.Failed:
            case SearchState.EstimateFailed:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.MailboxSearchFailed);
                break;

            case SearchState.Stopping:
            case SearchState.EstimateStopping:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.MailboxSearchStopping);
                break;

            case SearchState.Stopped:
            case SearchState.EstimateStopped:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.MailboxSearchStopped);
                break;

            case SearchState.Succeeded:
            case SearchState.EstimateSucceeded:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.MailboxSearchSucceeded);
                break;

            case SearchState.PartiallySucceeded:
            case SearchState.EstimatePartiallySucceeded:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.MailboxSearchPartiallySucceeded);
                break;
            }
            return(result);
        }
Example #6
0
        public static string FromEnum(RecipientTypeDetails recipientType, Guid archiveGuid, bool isUserFederated)
        {
            string result = string.Empty;

            if (!archiveGuid.Equals(Guid.Empty))
            {
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.Archive16);
            }
            else
            {
                if (recipientType > RecipientTypeDetails.MailUniversalSecurityGroup)
                {
                    if (recipientType <= (RecipientTypeDetails)((ulong)-2147483648))
                    {
                        if (recipientType <= RecipientTypeDetails.PublicFolder)
                        {
                            if (recipientType == RecipientTypeDetails.DynamicDistributionGroup)
                            {
                                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.DynamicDistributionGroup));
                            }
                            if (recipientType != RecipientTypeDetails.PublicFolder)
                            {
                                return(result);
                            }
                            return(CommandSprite.GetCssClass(CommandSprite.SpriteId.MailEnabledPublicFolder));
                        }
                        else
                        {
                            if (recipientType == RecipientTypeDetails.MailForestContact)
                            {
                                goto IL_1DE;
                            }
                            if (recipientType != (RecipientTypeDetails)((ulong)-2147483648))
                            {
                                return(result);
                            }
                        }
                    }
                    else if (recipientType <= RecipientTypeDetails.RemoteEquipmentMailbox)
                    {
                        if (recipientType != RecipientTypeDetails.RemoteRoomMailbox && recipientType != RecipientTypeDetails.RemoteEquipmentMailbox)
                        {
                            return(result);
                        }
                    }
                    else if (recipientType != RecipientTypeDetails.RemoteSharedMailbox)
                    {
                        if (recipientType == RecipientTypeDetails.TeamMailbox)
                        {
                            goto IL_1A6;
                        }
                        if (recipientType != RecipientTypeDetails.RemoteTeamMailbox)
                        {
                            return(result);
                        }
                    }
                    return(CommandSprite.GetCssClass(CommandSprite.SpriteId.RemoteMailbox16));
                }
                if (recipientType <= RecipientTypeDetails.EquipmentMailbox)
                {
                    if (recipientType <= RecipientTypeDetails.LegacyMailbox)
                    {
                        if (recipientType <= RecipientTypeDetails.SharedMailbox)
                        {
                            if (recipientType < RecipientTypeDetails.UserMailbox)
                            {
                                return(result);
                            }
                            switch ((int)(recipientType - RecipientTypeDetails.UserMailbox))
                            {
                            case 0:
                                return(CommandSprite.GetCssClass(isUserFederated ? CommandSprite.SpriteId.Federated16 : CommandSprite.SpriteId.Mailbox16));

                            case 1:
                                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.Linked16));

                            case 2:
                                return(result);

                            case 3:
                                goto IL_1A6;
                            }
                        }
                        if (recipientType != RecipientTypeDetails.LegacyMailbox)
                        {
                            return(result);
                        }
                        return(CommandSprite.GetCssClass(CommandSprite.SpriteId.Legacy16));
                    }
                    else
                    {
                        if (recipientType == RecipientTypeDetails.RoomMailbox)
                        {
                            return(CommandSprite.GetCssClass(CommandSprite.SpriteId.Room16));
                        }
                        if (recipientType != RecipientTypeDetails.EquipmentMailbox)
                        {
                            return(result);
                        }
                        return(CommandSprite.GetCssClass(CommandSprite.SpriteId.Equipment16));
                    }
                }
                else if (recipientType <= RecipientTypeDetails.MailUser)
                {
                    if (recipientType == RecipientTypeDetails.MailContact)
                    {
                        goto IL_1DE;
                    }
                    if (recipientType != RecipientTypeDetails.MailUser)
                    {
                        return(result);
                    }
                    return(CommandSprite.GetCssClass(CommandSprite.SpriteId.MailUser));
                }
                else
                {
                    if (recipientType != RecipientTypeDetails.MailUniversalDistributionGroup && recipientType != RecipientTypeDetails.MailNonUniversalGroup && recipientType != RecipientTypeDetails.MailUniversalSecurityGroup)
                    {
                        return(result);
                    }
                    return(CommandSprite.GetCssClass(CommandSprite.SpriteId.DistributionGroup16));
                }
IL_1A6:
                return(CommandSprite.GetCssClass(CommandSprite.SpriteId.Shared16));

IL_1DE:
                result = CommandSprite.GetCssClass(CommandSprite.SpriteId.Contact);
            }
            return(result);
        }