示例#1
0
        private static string FromEnum(Type enumType, object value, ExchangeResourceManager resourceManager)
        {
            string result = null;

            if (resourceManager != null)
            {
                string   text  = LocalizedDescriptionAttribute.Enum2LocStringId(enumType, value);
                string[] array = text.ToString().Split(new char[]
                {
                    ','
                });
                StringBuilder stringBuilder = new StringBuilder();
                int           i;
                for (i = 0; i < array.Length; i++)
                {
                    string @string = resourceManager.GetString(array[i].Trim());
                    if (@string == null)
                    {
                        throw new InvalidOperationException(string.Format("failed to find locstring id={0}. This string is used as LocDescription of {1} value in enum type {2}", array[i], value, enumType.FullName));
                    }
                    if (i != 0)
                    {
                        stringBuilder.Append(", ");
                    }
                    stringBuilder.Append(@string);
                }
                if (i == array.Length)
                {
                    result = stringBuilder.ToString();
                }
            }
            return(result);
        }
示例#2
0
 public RecipientRow(MailEnabledRecipient recipient) : base(recipient.ToIdentity(), recipient)
 {
     this.PrimarySmtpAddress      = recipient.PrimarySmtpAddress.ToString();
     this.SpriteId                = Icons.FromEnum(recipient.RecipientTypeDetails);
     this.RecipientTypeDetails    = recipient.RecipientTypeDetails.ToString();
     this.LocRecipientTypeDetails = LocalizedDescriptionAttribute.FromEnum(typeof(RecipientTypeDetails), recipient.RecipientTypeDetails);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     foreach (object obj in Enum.GetValues(typeof(CalendarReminder)))
     {
         CalendarReminder   calendarReminder = (CalendarReminder)obj;
         ListItemCollection items            = this.ddlDefaultReminderTime.Items;
         string             text             = LocalizedDescriptionAttribute.FromEnum(typeof(CalendarReminder), calendarReminder);
         int num = (int)calendarReminder;
         items.Add(new ListItem(text, num.ToString()));
     }
 }
示例#4
0
 static LocalizedDescriptionAttribute()
 {
     LocalizedDescriptionAttribute.AddType(typeof(IncidentReportOriginalMail), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ADAttribute), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(AddedRecipientType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DisclaimerFallbackAction), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(EvaluatedUser), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(Evaluation), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(FromUserScope), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ManagementRelationship), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(MessageType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(NotifySenderType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ToUserScope), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(RuleMode), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(AuthenticationMethod), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(AcceptedDomainType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ElcFolderType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(MasterType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(RetentionActionType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ServerRole), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(CopyStatus), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ContentIndexStatusType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ServerEditionType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(AsyncOperationType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(ClientExtensionProvidedTo), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DefaultStateForUser), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(MailboxFolderPermissionRole), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(_DeliveryStatus), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(DeviceAccessState), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(DeviceAccessStateReason), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(DevicePolicyApplicationStatus), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(DeviceRemoteWipeStatus), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(ExtensionInstallScope), LocalizedDescriptionAttribute.enumStringsResourceManagerForOwaOption, true);
     LocalizedDescriptionAttribute.AddType(typeof(ArchiveState), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(GroupTypeFlags), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(RecipientTypeDetails), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(WellKnownRecipientType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DeviceAccessState), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(GroupNamingPolicyAttributeEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(AudioCodecEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(AutoAttendantDisambiguationFieldEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DialByNamePrimaryEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DialByNameSecondaryEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DisambiguationFieldEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(DRMProtectionOptions), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(GatewayStatus), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(StatusEnum), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(UMUriType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(UMVoIPSecurityType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(SpamFilteringAction), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(SpamFilteringOption), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
     LocalizedDescriptionAttribute.AddType(typeof(TenantConnectorType), LocalizedDescriptionAttribute.enumStringsResourceManager, false);
 }
示例#5
0
        private void FillWeekDaysDropDownList()
        {
            Array values = Enum.GetValues(typeof(Microsoft.Exchange.Data.Storage.Management.DayOfWeek));

            foreach (object obj in values)
            {
                Microsoft.Exchange.Data.Storage.Management.DayOfWeek dayOfWeek = (Microsoft.Exchange.Data.Storage.Management.DayOfWeek)obj;
                ListItemCollection items = this.ddlWeekStartDay.Items;
                string             text  = LocalizedDescriptionAttribute.FromEnum(typeof(Microsoft.Exchange.Data.Storage.Management.DayOfWeek), dayOfWeek);
                int num = (int)dayOfWeek;
                items.Add(new ListItem(text, num.ToString()));
            }
        }
示例#6
0
        private static string FromEnum(Type enumType, object value, Dictionary <Type, ExchangeResourceManager> enumType2ResourceManagerTable)
        {
            string text = null;

            if (enumType2ResourceManagerTable.ContainsKey(enumType))
            {
                text = LocalizedDescriptionAttribute.FromEnum(enumType, value, enumType2ResourceManagerTable[enumType]);
            }
            if (text == null)
            {
                text = LocalizedDescriptionAttribute.FromEnum(enumType, value);
            }
            return(text);
        }
示例#7
0
 public DatabaseCopyStatus(DatabaseCopyStatusEntry statusEntry)
 {
     this.Name                    = statusEntry.Name;
     this.RawIdentity             = statusEntry.Id.ObjectGuid.ToString();
     this.IsActive                = statusEntry.ActiveCopy;
     this.StatusString            = LocalizedDescriptionAttribute.FromEnum(typeof(CopyStatus), statusEntry.Status);
     this.CopyQueueLength         = ((statusEntry.CopyQueueLength != null) ? statusEntry.CopyQueueLength.Value.ToString() : "0");
     this.ContentIndexStateString = LocalizedDescriptionAttribute.FromEnum(typeof(ContentIndexStatusType), statusEntry.ContentIndexState);
     this.SuspendComment          = statusEntry.SuspendComment;
     this.CanSuspend              = (statusEntry.Status == CopyStatus.Failed || statusEntry.Status == CopyStatus.Seeding || statusEntry.Status == CopyStatus.Healthy || statusEntry.Status == CopyStatus.Initializing || statusEntry.Status == CopyStatus.Resynchronizing || statusEntry.Status == CopyStatus.DisconnectedAndHealthy || statusEntry.Status == CopyStatus.DisconnectedAndResynchronizing);
     this.CanResume               = (statusEntry.Status == CopyStatus.Suspended || statusEntry.Status == CopyStatus.FailedAndSuspended);
     this.CanRemove               = (statusEntry.Status == CopyStatus.Failed || statusEntry.Status == CopyStatus.Seeding || statusEntry.Status == CopyStatus.Suspended || statusEntry.Status == CopyStatus.Healthy || statusEntry.Status == CopyStatus.Initializing || statusEntry.Status == CopyStatus.Resynchronizing || statusEntry.Status == CopyStatus.DisconnectedAndHealthy || statusEntry.Status == CopyStatus.FailedAndSuspended || statusEntry.Status == CopyStatus.DisconnectedAndResynchronizing || statusEntry.Status == CopyStatus.NonExchangeReplication || statusEntry.Status == CopyStatus.SeedingSource || statusEntry.Status == CopyStatus.Misconfigured);
     this.CanActivate             = (statusEntry.Status == CopyStatus.Healthy || statusEntry.Status == CopyStatus.DisconnectedAndHealthy || statusEntry.Status == CopyStatus.DisconnectedAndResynchronizing || statusEntry.Status == CopyStatus.Initializing || statusEntry.Status == CopyStatus.Resynchronizing);
     this.CanUpdate               = (statusEntry.Status == CopyStatus.Suspended || statusEntry.Status == CopyStatus.FailedAndSuspended);
 }
示例#8
0
        private void FillFirstWeekOfYearDropDownList()
        {
            Array values = Enum.GetValues(typeof(FirstWeekRules));

            foreach (object obj in values)
            {
                FirstWeekRules firstWeekRules = (FirstWeekRules)obj;
                if (firstWeekRules != FirstWeekRules.LegacyNotSet)
                {
                    ListItemCollection items = this.ddlFirstWeekOfYear.Items;
                    string             text  = LocalizedDescriptionAttribute.FromEnum(typeof(FirstWeekRules), firstWeekRules);
                    int num = (int)firstWeekRules;
                    items.Add(new ListItem(text, num.ToString()));
                }
            }
        }
示例#9
0
        public static string GetLocalizedType(ElcFolderType retentionTagType)
        {
            string result = LocalizedDescriptionAttribute.FromEnum(typeof(ElcFolderType), retentionTagType);

            if (retentionTagType != ElcFolderType.All)
            {
                if (retentionTagType == ElcFolderType.Personal)
                {
                    result = Strings.RetentionTagTypePersonal;
                }
            }
            else
            {
                result = Strings.RetentionTagTypeAll;
            }
            return(result);
        }
        protected override void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            descriptor.AddProperty("AuditLevelPropertyName", "SetAuditSeverity", true);
            descriptor.AddProperty("SenderAddressLocationPropertyName", "SenderAddressLocation", true);
            descriptor.AddProperty("ActivationDatePropertyName", "ActivationDate", true);
            descriptor.AddProperty("ExpiryDatePropertyName", "ExpiryDate", true);
            descriptor.AddProperty("UseLegecyRegExParameterName", "UseLegacyRegex", true);
            descriptor.AddProperty("DLPPolicyParameterName", "DlpPolicy", true);
            descriptor.AddProperty("ModePropertyName", "Mode", true);
            descriptor.AddProperty("StopProcessingRuleParameterName", "StopRuleProcessing", true);
            descriptor.AddProperty("CommentsPropertyName", "Comments", true);
            descriptor.AddProperty("TransportRuleAgentErrorActionName", "RuleErrorAction", true);
            descriptor.AddProperty("PriorityParameterName", "Priority", true);
            descriptor.AddElementProperty("ActivationExpiryContainer", this.activationExpiryPanel.ClientID, false);
            descriptor.AddComponentProperty("ActivationDatePicker", this.dtpActivationDate.ClientID, false);
            descriptor.AddComponentProperty("ExpiryDatePicker", this.dtpExpiryDate.ClientID, false);
            descriptor.AddElementProperty("ActivationDateCheckbox", this.chkActivationDate.ClientID);
            descriptor.AddElementProperty("ExpiryDateCheckbox", this.chkExpiryDate.ClientID);
            descriptor.AddElementProperty("RuleModeContainer", this.ruleModePanel.ClientID, false);
            descriptor.AddComponentProperty("RuleModeList", this.radRuleMode.ClientID, this);
            descriptor.AddElementProperty("RuleCommentsContainer", this.ruleCommentsPanel.ClientID, false);
            descriptor.AddElementProperty("CommentsField", this.txtComment.ClientID, this);
            descriptor.AddProperty("NotifySenderActionName", "NotifySender", true);
            descriptor.AddProperty("RejectMessageActionName", "RejectMessage", true);
            descriptor.AddProperty("RejectMessageStatusCodeActionName", "RejectMessageEnhancedStatusCode", true);
            descriptor.AddProperty("AuditLevelValues", new EnumValue[]
            {
                new EnumValue(Strings.ReportSeverityLevelLow, "Low"),
                new EnumValue(Strings.ReportSeverityLevelMedium, "Medium"),
                new EnumValue(Strings.ReportSeverityLevelHigh, "High"),
                new EnumValue(Strings.ReportSeverityLevelAuditNone, string.Empty)
            });
            descriptor.AddProperty("PolicyGroupMembershipValues", this.QueryDLPPolicies());
            List <EnumValue> list = new List <EnumValue>();

            foreach (object obj in Enum.GetValues(typeof(SenderAddressLocation)))
            {
                list.Add(new EnumValue(LocalizedDescriptionAttribute.FromEnum(typeof(SenderAddressLocation), obj), obj.ToString()));
            }
            descriptor.AddProperty("SenderAddressLocationValues", list.ToArray());
            descriptor.AddElementProperty("RulePriorityContainer", this.rulePriorityPanel.ClientID, false);
            descriptor.AddElementProperty("PriorityTextbox", this.numberControl.ClientID, this);
            base.BuildScriptDescriptor(descriptor);
        }
示例#11
0
        public static void PopulateRetentionTypes(DropDownList ddlRetentionType)
        {
            Type typeFromHandle = typeof(ElcFolderType);

            foreach (object obj in Enum.GetValues(typeFromHandle))
            {
                ElcFolderType elcFolderType = (ElcFolderType)obj;
                if (elcFolderType != ElcFolderType.ManagedCustomFolder && elcFolderType != ElcFolderType.NonIpmRoot && elcFolderType != ElcFolderType.LegacyArchiveJournals && elcFolderType != ElcFolderType.All && elcFolderType != ElcFolderType.Personal && elcFolderType != ElcFolderType.RecoverableItems && elcFolderType != ElcFolderType.Contacts && elcFolderType != ElcFolderType.Tasks)
                {
                    string   value = LocalizedDescriptionAttribute.FromEnum(typeFromHandle, elcFolderType);
                    string   text  = elcFolderType.ToString();
                    ListItem item  = new ListItem(RtlUtil.ConvertToDecodedBidiString(value, RtlUtil.IsRtl), text);
                    ddlRetentionType.Items.Add(item);
                    if (elcFolderType == ElcFolderType.Inbox)
                    {
                        ddlRetentionType.SelectedValue = text;
                    }
                }
            }
        }
		private string GetLocalizedRetentionAction(bool retentionEnabled, RetentionActionType retentionActionType)
		{
			string result = LocalizedDescriptionAttribute.FromEnum(typeof(RetentionActionType), retentionActionType);
			bool flag = retentionActionType == RetentionActionType.MoveToArchive;
			if (retentionActionType == RetentionActionType.DeleteAndAllowRecovery)
			{
				result = OwaOptionStrings.RetentionActionDeleteAndAllowRecovery;
			}
			if (!retentionEnabled)
			{
				if (flag)
				{
					result = OwaOptionStrings.RetentionActionNeverMove;
				}
				else
				{
					result = OwaOptionStrings.RetentionActionNeverDelete;
				}
			}
			return result;
		}
示例#13
0
 public MobileDeviceInfo(MobileDeviceConfiguration configuration)
 {
     this.Identity                  = ((ADObjectId)configuration.Identity).ToIdentity();
     this.DeviceType                = configuration.DeviceType;
     this.DeviceModel               = configuration.DeviceModel;
     this.DeviceAccessState         = ((configuration.Status == DeviceRemoteWipeStatus.DeviceOk) ? LocalizedDescriptionAttribute.FromEnum(configuration.DeviceAccessState.GetType(), configuration.DeviceAccessState) : LocalizedDescriptionAttribute.FromEnum(configuration.Status.GetType(), configuration.Status));
     this.DevicePhoneNumber_LtrSpan = (string.IsNullOrEmpty(configuration.DevicePhoneNumber) ? Strings.NotAvailable : string.Format("<span dir=\"ltr\">{0}</span>", HttpUtility.HtmlEncode(configuration.DevicePhoneNumber)));
     this.IsRemoteWipeSupported     = configuration.IsRemoteWipeSupported;
     this.DeviceStatusIsOK          = (configuration.Status == DeviceRemoteWipeStatus.DeviceOk);
     this.ClientType                = configuration.ClientType.ToString();
 }
示例#14
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            RuleRow ruleObject = this.GetRuleObject();

            if (ruleObject == null)
            {
                return;
            }
            if (!ruleObject.Supported && !this.UnsupportedRuleDescription.IsNullOrBlank())
            {
                Label label = new Label();
                label.Text     = this.UnsupportedRuleDescription;
                label.CssClass = "RuleDetailsPanel_SectionHeader";
                label.ID       = "lblTitle";
                this.Controls.Add(label);
                return;
            }
            Label label2 = new Label();

            label2.Text     = HttpUtility.HtmlEncode(ruleObject.Name);
            label2.CssClass = "RuleDetailsPanel_RuleName";
            label2.ID       = "lblTitle";
            this.Controls.Add(label2);
            Panel child;

            if (ruleObject.ConditionDescriptions.Length > 0)
            {
                child = this.CreateDescriptionsPane("divCondition", this.ConditionHeaderString, ruleObject.ConditionDescriptions, Strings.RuleDescriptionAndDelimiter);
            }
            else
            {
                string[] descriptionArray = new string[]
                {
                    this.ApplyToAllRuleDescription
                };
                child = this.CreateDescriptionsPane("divCondition", this.ConditionHeaderString, descriptionArray, Strings.RuleDescriptionAndDelimiter);
            }
            this.Controls.Add(child);
            if (ruleObject.ActionDescriptions.Length > 0)
            {
                Panel child2 = this.CreateDescriptionsPane("divAction", Strings.RuleActionSectionHeader, ruleObject.ActionDescriptions, Strings.RuleDescriptionAndDelimiter);
                this.Controls.Add(child2);
                if (ruleObject is TransportRule)
                {
                    TransportRule transportRule = (TransportRule)ruleObject;
                    if (null != transportRule.GenerateIncidentReport && RbacPrincipal.Current.IsInRole("OWA") && MailboxPermissions.CanAccessMailboxOf(transportRule.GenerateIncidentReport.RawIdentity))
                    {
                        this.CreateIncidentManagementLink(transportRule);
                    }
                }
            }
            if (ruleObject.ExceptionDescriptions.Length > 0)
            {
                Panel child3 = this.CreateDescriptionsPane("divException", Strings.RuleExceptionSectionHeader, ruleObject.ExceptionDescriptions, Strings.RuleDescriptionOrDelimiter);
                this.Controls.Add(child3);
            }
            if (!string.IsNullOrEmpty(ruleObject.DlpPolicy))
            {
                Label label3 = new Label();
                label3.Text     = HttpUtility.HtmlEncode(Strings.DLPPolicyMailFlowNameColumn);
                label3.CssClass = "RuleDetailsPanel_SectionHeader";
                label3.ID       = "lblDLPPolicy";
                this.Controls.Add(label3);
                HtmlGenericControl htmlGenericControl = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
                htmlGenericControl.Attributes.Add("class", "RuleDetailsPanel_Description");
                htmlGenericControl.ID        = "dlppolicy_description";
                htmlGenericControl.InnerText = ruleObject.DlpPolicy;
                this.Controls.Add(htmlGenericControl);
            }
            List <string> list = new List <string>();

            if (ruleObject is TransportRule)
            {
                TransportRule transportRule2 = (TransportRule)ruleObject;
                if (transportRule2.Comments != null)
                {
                    Label label4 = new Label();
                    label4.Text     = HttpUtility.HtmlEncode(Strings.RuleCommentsLabel);
                    label4.CssClass = "RuleDetailsPanel_SectionHeader";
                    label4.ID       = "lblRuleComment";
                    this.Controls.Add(label4);
                    HtmlGenericControl htmlGenericControl2 = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
                    htmlGenericControl2.Attributes.Add("class", "RuleDetailsPanel_Description");
                    htmlGenericControl2.ID        = "lblRuleComment_description";
                    htmlGenericControl2.InnerText = transportRule2.Comments;
                    this.Controls.Add(htmlGenericControl2);
                }
                if (!string.IsNullOrEmpty(transportRule2.Mode))
                {
                    Label label5 = new Label();
                    label5.Text     = HttpUtility.HtmlEncode(Strings.RuleMode);
                    label5.CssClass = "RuleDetailsPanel_SectionHeader";
                    label5.ID       = "lblRuleMode";
                    this.Controls.Add(label5);
                    HtmlGenericControl htmlGenericControl3 = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
                    htmlGenericControl3.Attributes.Add("class", "RuleDetailsPanel_Description");
                    htmlGenericControl3.ID        = "dlppolicy_mode";
                    htmlGenericControl3.InnerText = LocalizedDescriptionAttribute.FromEnum(typeof(RuleMode), (RuleMode)Enum.Parse(typeof(RuleMode), transportRule2.Mode, true));
                    this.Controls.Add(htmlGenericControl3);
                }
                string format;
                if (EacRbacPrincipal.Instance.DateFormat != null && EacRbacPrincipal.Instance.TimeFormat != null)
                {
                    format = EacRbacPrincipal.Instance.DateFormat + " " + EacRbacPrincipal.Instance.TimeFormat;
                }
                else
                {
                    format = "yyyy/MM/dd HH:mm:ss";
                }
                if (transportRule2.ActivationDate != null)
                {
                    list.Add(ruleObject.ActivationDateDescription + " " + transportRule2.ActivationDate.Value.ToString(format));
                }
                if (transportRule2.ExpiryDate != null)
                {
                    list.Add(ruleObject.ExpiryDateDescription + " " + transportRule2.ExpiryDate.Value.ToString(format));
                }
                if (transportRule2.SenderAddressLocation != null)
                {
                    list.Add(string.Format(Strings.RuleSenderAddressMatches, LocalizedDescriptionAttribute.FromEnum(typeof(SenderAddressLocation), Enum.Parse(typeof(SenderAddressLocation), transportRule2.SenderAddressLocation, true))));
                }
                if (transportRule2.RuleErrorAction != null)
                {
                    RuleErrorAction ruleErrorAction = (RuleErrorAction)Enum.Parse(typeof(RuleErrorAction), transportRule2.RuleErrorAction, true);
                    if (ruleErrorAction == RuleErrorAction.Defer)
                    {
                        list.Add(string.Format(Strings.RuleBusinessContinuity, LocalizedDescriptionAttribute.FromEnum(typeof(RuleErrorAction), ruleErrorAction)));
                    }
                }
            }
            if (list.Count > 0)
            {
                Label label6 = new Label();
                label6.Text     = HttpUtility.HtmlEncode(Strings.RuleProperties);
                label6.CssClass = "RuleDetailsPanel_SectionHeader";
                label6.ID       = "lblAdditionalProps";
                this.Controls.Add(label6);
                HtmlGenericControl htmlGenericControl4 = new HtmlGenericControl(HtmlTextWriterTag.Div.ToString());
                htmlGenericControl4.Attributes.Add("class", "RuleDetailsPanel_Description");
                htmlGenericControl4.ID        = "properties_description";
                htmlGenericControl4.InnerHtml = string.Join(string.Empty, from s in list
                                                            select HttpUtility.HtmlEncode(s) + "<br />");
                this.Controls.Add(htmlGenericControl4);
            }
            if (null != ruleObject.RuleVersion)
            {
                Panel panel = new Panel();
                panel.Attributes.Add("class", "RuleDetailsPanel_Description");
                panel.Controls.Add(new Label
                {
                    Text = string.Format(Strings.RuleVersion, ruleObject.RuleVersion.ToString())
                });
                this.Controls.Add(panel);
            }
        }
示例#15
0
 public static string FromEnumForOwaOption(Type enumType, object value)
 {
     return(LocalizedDescriptionAttribute.FromEnum(enumType, value, LocalizedDescriptionAttribute.enumType2ResourceManagerTableForOwaOption));
 }