Exemplo n.º 1
0
 protected override void RenderMenuItems(TextWriter output)
 {
     if (PolicyProvider.MovePolicyProvider.IsPolicyEnabled(this.userContext.MailboxSession))
     {
         PolicyTagList    allPolicies = PolicyProvider.MovePolicyProvider.GetAllPolicies(this.userContext.MailboxSession);
         List <PolicyTag> list        = new List <PolicyTag>(allPolicies.Values.Count);
         foreach (PolicyTag policyTag in allPolicies.Values)
         {
             if (policyTag.IsVisible || object.Equals(policyTag.PolicyGuid, base.PolicyChecked))
             {
                 list.Add(policyTag);
             }
         }
         list.Sort(new Comparison <PolicyTag>(MovePolicyContextMenu.CompareMovePolicyValues));
         foreach (PolicyTag policyTag2 in list)
         {
             base.RenderPolicyTagMenuItem(output, policyTag2.PolicyGuid, PolicyContextMenuBase.GetDefaultDisplayName(policyTag2), false);
         }
         base.RenderInheritPolicyMenuItem(output, true, false);
     }
 }
Exemplo n.º 2
0
 // Token: 0x060022D3 RID: 8915 RVA: 0x000C7598 File Offset: 0x000C5798
 public static void AddDeletePolicyInformation(Infobar infobar, IStorePropertyBag storePropertyBag, UserContext userContext)
 {
     if (infobar == null)
     {
         throw new ArgumentNullException("infobar");
     }
     if (storePropertyBag == null)
     {
         throw new ArgumentNullException("storePropertyBag");
     }
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     if (PolicyProvider.DeletePolicyProvider.IsPolicyEnabled(userContext.MailboxSession) && ItemUtility.HasDeletePolicy(storePropertyBag))
     {
         ExDateTime now      = ExDateTime.Now;
         ExDateTime property = ItemUtility.GetProperty <ExDateTime>(storePropertyBag, ItemSchema.RetentionDate, ExDateTime.MinValue);
         if (property > ExDateTime.MinValue)
         {
             TimeSpan timeSpan  = property - now;
             string   s         = string.Format(LocalizedStrings.GetNonEncoded(217128690), (timeSpan.Days < 0) ? 0 : timeSpan.Days);
             Guid?    guid      = null;
             byte[]   property2 = ItemUtility.GetProperty <byte[]>(storePropertyBag, StoreObjectSchema.PolicyTag, null);
             if (property2 != null && property2.Length == InfobarMessageBuilder.SizeOfGuid)
             {
                 guid = new Guid?(new Guid(property2));
             }
             PolicyTagList    allPolicies = PolicyProvider.DeletePolicyProvider.GetAllPolicies(userContext.MailboxSession);
             List <PolicyTag> list        = new List <PolicyTag>(allPolicies.Values.Count);
             if (guid != null && allPolicies.Count > 0)
             {
                 foreach (PolicyTag policyTag in allPolicies.Values)
                 {
                     if (object.Equals(policyTag.PolicyGuid, guid))
                     {
                         list.Add(policyTag);
                     }
                 }
             }
             string s2 = string.Format(LocalizedStrings.GetNonEncoded(2084315882), (list.Count > 0) ? list[0].Name : string.Empty, (list.Count > 0) ? PolicyContextMenuBase.TimeSpanToString(list[0].TimeSpanForRetention) : string.Empty, property.ToString("d", CultureInfo.CurrentUICulture));
             infobar.AddMessage(Utilities.SanitizeHtmlEncode(s2), InfobarMessageType.Informational);
             if (timeSpan.Days < 30)
             {
                 infobar.AddMessage(Utilities.SanitizeHtmlEncode(s), InfobarMessageType.Informational);
             }
         }
     }
 }
Exemplo n.º 3
0
 // Token: 0x06001FD9 RID: 8153 RVA: 0x000B844D File Offset: 0x000B664D
 internal static string GetDefaultDisplayName(PolicyTag policyTag)
 {
     return(string.Format(LocalizedStrings.GetNonEncoded(-1468060031), policyTag.Name, PolicyContextMenuBase.TimeSpanToString(policyTag.TimeSpanForRetention)));
 }