string GetRetentionFlagSettingAsString(RetentionFlags r) { string sRet = ""; int i = (int)r; sRet = "0x" + (i.ToString("X4")) + " = "; https: //msdn.microsoft.com/en-us/library/ee202166(v=exchg.80).aspx if (r == RetentionFlags.None) { sRet += "None (0x000). "; } else { if (r.HasFlag(RetentionFlags.ExplicitTag)) { sRet += "ExplicitTag (0x001) + "; } if (r.HasFlag(RetentionFlags.UserOverride)) { sRet += "UserOverride (0x002) + "; } if (r.HasFlag(RetentionFlags.Autotag)) { sRet += "Autotag (0x004) + "; } if (r.HasFlag(RetentionFlags.PersonalTag)) { sRet += "PersonalTag (0x0008) + "; } if (r.HasFlag(RetentionFlags.ExplictArchiveTag)) { sRet += "ExplictArchiveTag (0x0010) + "; } if (r.HasFlag(RetentionFlags.KeepInPlace)) { sRet += "KeepInPlace. (0x0020) + "; } if (r.HasFlag(RetentionFlags.SystemData)) { sRet += "SystemData. (0x0040) + "; } if (r.HasFlag(RetentionFlags.NeedsRescan)) { sRet += "NeedsRescan. (0x0080) + "; } if (r.HasFlag(RetentionFlags.PendingRescan)) { sRet += "PendingRescan. (0x0100)"; } } if (sRet.EndsWith(" + ")) { sRet = sRet.Remove(sRet.Length - 3, 3); sRet += "."; } return(sRet); }
string GetRetentionFlagSettingAsString(RetentionFlags r) { string sRet = ""; if (r.HasFlag(RetentionFlags.None)) { sRet += "None. "; } if (r.HasFlag(RetentionFlags.ExplicitTag)) { sRet += "ExplicitTag. "; } if (r.HasFlag(RetentionFlags.UserOverride)) { sRet += "UserOverride. "; } if (r.HasFlag(RetentionFlags.Autotag)) { sRet += "Autotag. "; } if (r.HasFlag(RetentionFlags.PersonalTag)) { sRet += "PersonalTag. "; } if (r.HasFlag(RetentionFlags.AllRetentionFlags)) { sRet += "AllRetentionFlags. "; } if (r.HasFlag(RetentionFlags.ExplictArchiveTag)) { sRet += "ExplictArchiveTag. "; } if (r.HasFlag(RetentionFlags.KeepInPlace)) { sRet += "KeepInPlace. "; } if (r.HasFlag(RetentionFlags.AllArchiveFlags)) { sRet += "AllArchiveFlags. "; } if (r.HasFlag(RetentionFlags.NeedsRescan)) { sRet += "NeedsRescan. "; } if (r.HasFlag(RetentionFlags.PendingRescan)) { sRet += "PendingRescan. "; } return(sRet); }