コード例 #1
0
        public static Guid?GetPolicyTagForArchiveFromItem(StoreObject item, out bool isExplicit, out bool isKeptInPlace, out DateTime?moveToArchive)
        {
            isExplicit    = false;
            moveToArchive = null;
            Guid?result = null;

            byte[] array = (byte[])item.GetValueOrDefault <object>(InternalSchema.ArchiveTag);
            if (array != null && array.Length == PolicyTagHelper.SizeOfGuid)
            {
                result = new Guid?(new Guid(array));
            }
            object valueOrDefault = item.GetValueOrDefault <object>(StoreObjectSchema.RetentionFlags);

            if (valueOrDefault != null && valueOrDefault is int)
            {
                isKeptInPlace = (((int)valueOrDefault & 32) != 0);
            }
            else
            {
                isKeptInPlace = false;
            }
            isExplicit    = (item.GetValueOrDefault <object>(StoreObjectSchema.ArchivePeriod) != null);
            moveToArchive = (DateTime?)item.GetValueAsNullable <ExDateTime>(ItemSchema.ArchiveDate);
            return(result);
        }
コード例 #2
0
        public static Guid?GetPolicyTagForDeleteFromItem(StoreObject item, out bool isExplicit, out DateTime?deleteTime)
        {
            isExplicit = false;
            deleteTime = null;
            Guid?result = null;

            byte[] array = (byte[])item.GetValueOrDefault <object>(InternalSchema.PolicyTag);
            if (array != null && array.Length == PolicyTagHelper.SizeOfGuid)
            {
                result = new Guid?(new Guid(array));
            }
            isExplicit = (item.GetValueOrDefault <object>(StoreObjectSchema.RetentionPeriod) != null);
            deleteTime = (DateTime?)item.GetValueAsNullable <ExDateTime>(ItemSchema.RetentionDate);
            return(result);
        }