示例#1
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);
             }
         }
     }
 }
示例#2
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)));
 }