Example #1
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 #2
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 #3
0
        public AjaxUploader() : base(HtmlTextWriterTag.Div)
        {
            this.HasDefaultValue = true;
            HtmlGenericControl htmlGenericControl = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());

            htmlGenericControl.Attributes["class"] = "AjaxUploaderNameDiv";
            this.fileNameLabel    = new EncodingLabel();
            this.fileNameLabel.ID = "fileNameLbl";
            htmlGenericControl.Controls.Add(this.fileNameLabel);
            this.progressLabel      = new EncodingLabel();
            this.progressLabel.ID   = "progressLbl";
            this.progressLabel.Text = Strings.Uploading;
            htmlGenericControl.Controls.Add(this.progressLabel);
            this.Controls.Add(htmlGenericControl);
            this.separator    = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
            this.separator.ID = "separator";
            this.separator.Attributes["class"] = "AjaxUploaderSeparator";
            this.Controls.Add(this.separator);
            htmlGenericControl = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
            htmlGenericControl.Attributes["class"] = "AjaxUploaderNameDiv";
            this.cancelButton             = new HyperLink();
            this.cancelButton.ID          = "cancelBtn";
            this.cancelButton.NavigateUrl = "#";
            this.cancelButton.Text        = Strings.CancelUpload;
            htmlGenericControl.Controls.Add(this.cancelButton);
            this.deleteButton             = new HyperLink();
            this.deleteButton.ID          = "deleteBtn";
            this.deleteButton.NavigateUrl = "#";
            CommandSprite commandSprite = new CommandSprite();

            commandSprite.ImageId       = CommandSprite.SpriteId.ToolBarDeleteSmall;
            commandSprite.AlternateText = Strings.DeleteCommandText;
            this.deleteButton.Controls.Add(commandSprite);
            htmlGenericControl.Controls.Add(this.deleteButton);
            EncodingLabel child  = Util.CreateHiddenForSRLabel(string.Empty, this.cancelButton.ID);
            EncodingLabel child2 = Util.CreateHiddenForSRLabel(string.Empty, this.deleteButton.ID);

            htmlGenericControl.Controls.Add(child);
            htmlGenericControl.Controls.Add(child2);
            this.Controls.Add(htmlGenericControl);
            this.Controls.Add(new LiteralControl("<br />"));
            htmlGenericControl = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
            htmlGenericControl.Attributes["class"] = "AjaxUploaderButtonDiv";
            this.editFileButton          = new IconButton();
            this.editFileButton.CssClass = "ajaxUploaderEditButton";
            this.editFileButton.ID       = "editFileBtn";
            if (string.IsNullOrEmpty(this.editFileButton.Text))
            {
                this.editFileButton.Text = Strings.DefaultEditButtonText;
            }
            htmlGenericControl.Controls.Add(this.editFileButton);
            this.uploaderBase    = new UploaderBase();
            this.uploaderBase.ID = "uploader";
            htmlGenericControl.Controls.Add(this.uploaderBase);
            this.Controls.Add(htmlGenericControl);
        }
Example #4
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 #5
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 #7
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);
        }