Exemplo n.º 1
0
 public override string ToString()
 {
     if (Enum.IsDefined(typeof(PropTag), this.Id))
     {
         PropTag id = (PropTag)this.Id;
         return(id.ToString());
     }
     if (Enum.IsDefined(typeof(CustomPropTag), this.Id))
     {
         CustomPropTag id2 = (CustomPropTag)this.Id;
         return(id2.ToString());
     }
     return(this.Id.ToString("X8"));
 }
 public object this[PropTag tag]
 {
     get
     {
         tag = RuleUtil.NormalizeTag(tag);
         object obj = this.CalculatePropertyValue(tag);
         if (obj == null)
         {
             obj = this.GetPropertyValue(tag);
         }
         RuleUtil.CheckValueType(obj, tag);
         return(obj);
     }
 }
        public static PropValue Pack(object value, MapiPropertyDefinition propertyDefinition)
        {
            PropTag  propertyTag = propertyDefinition.PropertyTag;
            PropType propType    = propertyTag.ValueType();
            Type     type        = MapiPropValueConvertor.TypeFromPropType(propType, false);

            if (value != null)
            {
                if (typeof(byte[]) == type)
                {
                    if (typeof(Guid) == value.GetType())
                    {
                        return(new PropValue(propertyTag, ((Guid)value).ToByteArray()));
                    }
                    if (typeof(Schedule) == value.GetType())
                    {
                        return(new PropValue(propertyTag, ((Schedule)value).ToByteArray()));
                    }
                }
                if (typeof(DateTime) == type && typeof(DateTime) == value.GetType())
                {
                    return(new PropValue(propertyTag, ((DateTime)value).ToUniversalTime()));
                }
                if (typeof(DateTime[]) == type)
                {
                    Type type2 = value.GetType();
                    if (typeof(MultiValuedProperty <DateTime>) == type2 || typeof(DateTime[]) == type2)
                    {
                        List <DateTime> list = new List <DateTime>(((ICollection)value).Count);
                        foreach (object obj in ((ICollection)value))
                        {
                            list.Add(((DateTime)obj).ToUniversalTime());
                        }
                        return(new PropValue(propertyTag, list.ToArray()));
                    }
                }
                if (type.IsAssignableFrom(value.GetType()))
                {
                    return(new PropValue(propertyTag, value));
                }
            }
            object value2 = null;

            if (MapiPropValueConvertor.TryCastValueToPack(value, propType, out value2))
            {
                return(new PropValue(propertyTag, value2));
            }
            throw MapiPropValueConvertor.ConstructPackingException(value, propertyDefinition, Strings.ConstantNa);
        }
Exemplo n.º 4
0
        List <MessageRec> IFolder.LookupMessages(PropTag ptagToLookup, List <byte[]> keysToLookup, PropTag[] additionalPtagsToLoad)
        {
            List <MessageRec> result = null;

            base.CreateContext("IFolder.LookupMessages", new DataContext[]
            {
                new SimpleValueDataContext("PropTag", ptagToLookup),
                new EntryIDsDataContext(keysToLookup),
                new PropTagsDataContext(additionalPtagsToLoad)
            }).Execute(delegate
            {
                result = this.WrappedObject.LookupMessages(ptagToLookup, keysToLookup, additionalPtagsToLoad);
            }, true);
            return(result);
        }
Exemplo n.º 5
0
        private static void ChangeStringPropTagTypeToUnicode(ref PropTag propTag)
        {
            PropType propType = propTag.ValueType();
            int      propId   = propTag.Id();

            if (propType == PropType.AnsiString)
            {
                propTag = PropTagHelper.PropTagFromIdAndType(propId, PropType.String);
                return;
            }
            if (propType == PropType.AnsiStringArray)
            {
                propTag = PropTagHelper.PropTagFromIdAndType(propId, PropType.StringArray);
            }
        }
        // Token: 0x06001374 RID: 4980 RVA: 0x00071898 File Offset: 0x0006FA98
        private static void AddProperty(PropTag propTag, OABPropertyFlags flags, Dictionary <PropTag, OABPropertyFlags> properties)
        {
            OABPropertyFlags oabpropertyFlags;

            if (properties.TryGetValue(propTag, out oabpropertyFlags))
            {
                PropertyManager.Tracer.TraceDebug <PropTag, OABPropertyFlags, OABPropertyFlags>(0L, "PropertyManager.AddProperty: merging property={0} existing flags {1} with {2}", propTag, oabpropertyFlags, flags);
                flags |= oabpropertyFlags;
            }
            else
            {
                PropertyManager.Tracer.TraceDebug <PropTag, OABPropertyFlags>(0L, "PropertyManager.AddProperty: adding property={0}, flags={1}", propTag, flags);
            }
            properties[propTag] = flags;
        }
Exemplo n.º 7
0
        protected static Restriction CreatePropertyRestriction <T>(PropTag propertyTag, T value)
        {
            Restriction result;

            if ((PropTag)4096U == ((PropTag)4096U & propertyTag))
            {
                PropTag tag = propertyTag & (PropTag)4294963199U;
                result = new Restriction.PropertyRestriction(Restriction.RelOp.Equal, tag, true, value);
            }
            else
            {
                result = Restriction.EQ(propertyTag, value);
            }
            return(result);
        }
Exemplo n.º 8
0
        private void SetProps(IPropertyBag propertyBag, PropValueData[] pvda)
        {
            if (pvda == null)
            {
                return;
            }
            int i = 0;

            while (i < pvda.Length)
            {
                PropValueData propValueData = pvda[i];
                object        obj           = propValueData.Value;
                if (obj is DateTime)
                {
                    obj = new ExDateTime(ExTimeZone.TimeZoneFromKind(((DateTime)obj).Kind), (DateTime)obj);
                }
                PropTag propTag  = (PropTag)propValueData.PropTag;
                PropTag propTag2 = propTag;
                if (propTag2 == PropTag.MessageFlags)
                {
                    MessageFlags messageFlags = StorageFxProxyPool.UpdateMessageFlags(propertyBag, (MessageFlags)((int)obj));
                    obj = (int)messageFlags;
                    goto IL_8B;
                }
                if (propTag2 != (PropTag)276824067U)
                {
                    goto IL_8B;
                }
                if (StorageFxProxyPool.ShouldUpdateIconIndex(propertyBag, (IconIndex)obj))
                {
                    goto Block_5;
                }
IL_B5:
                i++;
                continue;
Block_5:
                try
                {
IL_8B:
                    propertyBag.SetProperty(new PropertyValue(new PropertyTag((uint)propValueData.PropTag), obj));
                }
                catch (ArgumentException ex)
                {
                    throw new ExArgumentException(ex.Message, ex);
                }
                goto IL_B5;
            }
        }
Exemplo n.º 9
0
        public void PrefetchSourceMessageIdsFromTargetMessageIds(EntryIdMap <List <byte[]> > destMessagesToTranslate)
        {
            this.prefetchedSourceEntryIdMap.Clear();
            PropTag sourceEntryIDPtag = this.Merger.DestHierarchy.SourceEntryIDPtag;

            PropTag[] additionalPtagsToLoad = new PropTag[]
            {
                sourceEntryIDPtag
            };
            foreach (KeyValuePair <byte[], List <byte[]> > keyValuePair in destMessagesToTranslate)
            {
                byte[]        key   = keyValuePair.Key;
                List <byte[]> value = keyValuePair.Value;
                foreach (byte[] key2 in value)
                {
                    this.prefetchedSourceEntryIdMap[key2] = null;
                }
                using (IDestinationFolder folder = this.Merger.DestMailbox.GetFolder(key))
                {
                    if (folder == null)
                    {
                        MrsTracer.Service.Warning("Destination folder {0} disappeared", new object[]
                        {
                            TraceUtils.DumpEntryId(key)
                        });
                    }
                    else
                    {
                        List <MessageRec> list = folder.LookupMessages(PropTag.EntryId, value, additionalPtagsToLoad);
                        foreach (MessageRec messageRec in list)
                        {
                            byte[] array = messageRec[sourceEntryIDPtag] as byte[];
                            if (array == null)
                            {
                                MrsTracer.Service.Warning("Destination message {0} doesn't have mapped source message", new object[]
                                {
                                    TraceUtils.DumpEntryId(messageRec.EntryId)
                                });
                            }
                            else
                            {
                                this.prefetchedSourceEntryIdMap[messageRec.EntryId] = array;
                            }
                        }
                    }
                }
            }
        }
        // Token: 0x060012C4 RID: 4804 RVA: 0x0006D934 File Offset: 0x0006BB34
        private static void SkipProperty(PropTag propTag, byte[] recordBuffer, ref int propertyOffset)
        {
            int i   = 1;
            int num = 0;

            if (propTag.IsMultiValued())
            {
                DiffFileGenerator.GetV4IntegerValue(recordBuffer, ref propertyOffset, out i);
            }
            while (i > 0)
            {
                PropType propType = propTag.ValueType() & (PropType)(-4097);
                if (propType <= PropType.Boolean)
                {
                    if (propType != PropType.Int && propType != PropType.Boolean)
                    {
                        goto IL_69;
                    }
                    DiffFileGenerator.GetV4IntegerValue(recordBuffer, ref propertyOffset, out num);
                }
                else
                {
                    switch (propType)
                    {
                    case PropType.AnsiString:
                    case PropType.String:
                        while (recordBuffer[propertyOffset++] != 0)
                        {
                        }
                        break;

                    default:
                        if (propType != PropType.Binary)
                        {
                            goto IL_69;
                        }
                        goto IL_69;
                    }
                }
IL_78:
                i--;
                continue;
IL_69:
                DiffFileGenerator.GetV4IntegerValue(recordBuffer, ref propertyOffset, out num);
                propertyOffset += num;
                goto IL_78;
            }
        }
Exemplo n.º 11
0
        private static bool EvaluateContentRestriction(Restriction.ContentRestriction restriction, IRuleEvaluationContext context)
        {
            RestrictionEvaluator.ValidateContentRestriction(restriction);
            PropTag propTag = restriction.PropTag;

            if (restriction.MultiValued)
            {
                propTag = RuleUtil.GetMultiValuePropTag(propTag);
            }
            context.TraceFunction <PropTag, ContentFlags, object>("ContentRestriction tag [{0}] flags [{1}] value [{2}]", propTag, restriction.Flags, restriction.PropValue.Value);
            object obj = context[propTag];
            bool   flag;

            if (obj == null)
            {
                flag = false;
            }
            else if (restriction.MultiValued)
            {
                flag = RestrictionEvaluator.MatchMultiValueWithPattern(context, restriction.PropTag, obj, restriction.PropValue.Value, restriction.Flags);
            }
            else if (RuleUtil.IsTextProp(restriction.PropTag))
            {
                flag = RestrictionEvaluator.MatchString(context.LimitChecker, context.CultureInfo, (string)obj, (string)restriction.PropValue.Value, restriction.Flags);
            }
            else
            {
                if (!RuleUtil.IsBinaryProp(restriction.PropTag))
                {
                    throw new InvalidRuleException(string.Format("Content restriction can't be used on tag {0}", restriction.PropTag));
                }
                flag = RestrictionEvaluator.MatchByteArray(context.LimitChecker, (byte[])obj, (byte[])restriction.PropValue.Value, restriction.Flags);
            }
            context.TraceFunction <bool, object>("ContentRestriction Evaluated to {0} with property value [{1}]", flag, obj);
            if (!flag && propTag == PropTag.SenderSearchKey)
            {
                object obj2 = context[PropTag.SenderSmtpAddress];
                if (obj2 != null)
                {
                    string       @string      = CTSGlobals.AsciiEncoding.GetString((byte[])restriction.PropValue.Value);
                    ContentFlags contentFlags = ContentFlags.SubString | ContentFlags.IgnoreCase;
                    context.TraceFunction("No match found in SenderSearchKey, searching for string in SenderSmtpAddress...");
                    context.TraceFunction <PropTag, ContentFlags, string>("ContentRestriction tag [{0}] flags [{1}] value [{2}]", PropTag.SenderSmtpAddress, contentFlags, @string);
                    flag = RestrictionEvaluator.MatchString(context.LimitChecker, context.CultureInfo, (string)obj2, @string, contentFlags);
                }
            }
            return(flag);
        }
Exemplo n.º 12
0
        internal static PropTag NormalizeTag(PropTag tag)
        {
            PropType propType = tag.ValueType() & (PropType)(-12289);

            if (propType == PropType.AnsiString)
            {
                propType = ((tag.ValueType() & PropType.MultiValueFlag) | PropType.String);
                tag      = PropTagHelper.PropTagFromIdAndType(tag.Id(), propType);
            }
            else
            {
                propType = (tag.ValueType() & (PropType)(-8193));
                tag      = PropTagHelper.PropTagFromIdAndType(tag.Id(), propType);
            }
            return(tag);
        }
Exemplo n.º 13
0
 private static RuleAction.ForwardActionBase.ActionRecipient GetRecipient(StoreSession session, ExTimeZone timeZone, AdrEntry adrEntry)
 {
     Util.ThrowOnNullArgument(adrEntry, "adrEntry");
     PropTag[] array = new PropTag[adrEntry.Values.Length];
     for (int i = 0; i < array.Length; i++)
     {
         array[i] = adrEntry.Values[i].PropTag;
     }
     NativeStorePropertyDefinition[] array2 = PropertyTagCache.Cache.SafePropertyDefinitionsFromPropTags(session, array);
     object[] array3 = new object[adrEntry.Values.Length];
     for (int j = 0; j < array3.Length; j++)
     {
         array3[j] = MapiPropertyBag.GetValueFromPropValue(session, timeZone, array2[j], adrEntry.Values[j]);
     }
     return(new RuleAction.ForwardActionBase.ActionRecipient(array2, array3));
 }
Exemplo n.º 14
0
        private static Restriction BuildBasicRestriction(QueryFilter filter, PropTag ptagToSearch, object propValue)
        {
            TextFilter textFilter = filter as TextFilter;

            if (textFilter != null)
            {
                return(ContentFilterBuilder.BuildTextRestriction(textFilter, ptagToSearch, propValue));
            }
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            if (comparisonFilter != null)
            {
                return(ContentFilterBuilder.BuildComparisonRestriction(comparisonFilter, ptagToSearch, propValue));
            }
            return(null);
        }
        // Token: 0x060012C5 RID: 4805 RVA: 0x0006D9C4 File Offset: 0x0006BBC4
        private static object GetPropertyValue(PropTag propTag, byte[] recordBuffer, ref int propertyOffset, bool isFromOldFile)
        {
            PropType propType = propTag.ValueType() & (PropType)(-4097);
            object   result;

            switch (propType)
            {
            case PropType.AnsiString:
            case PropType.String:
            {
                int num = propertyOffset;
                while (recordBuffer[propertyOffset] != 0)
                {
                    propertyOffset++;
                }
                result = Encoding.UTF8.GetString(recordBuffer, num, propertyOffset - num);
                break;
            }

            default:
            {
                if (propType != PropType.Binary)
                {
                    throw new NotSupportedException(string.Format("GetProperty doesn't support property type {0} now", propTag.ValueType()));
                }
                int num2;
                DiffFileGenerator.GetV4IntegerValue(recordBuffer, ref propertyOffset, out num2);
                if (num2 <= 0)
                {
                    OABLogger.LogRecord(TraceType.FatalTrace, "Invalid binary property data for tag {0} from {1} file . The offset is {2}. The binary blob is {3}", new object[]
                        {
                            propTag.ToString(),
                            isFromOldFile ? "old" : "new",
                            propertyOffset,
                            BitConverter.ToString(recordBuffer)
                        });
                    throw new InvalidDataException(string.Format("Invalid binary property data for tag {0}", propTag.ToString()));
                }
                byte[] array = new byte[num2];
                Array.Copy(recordBuffer, propertyOffset, array, 0, num2);
                propertyOffset += num2;
                result          = array;
                break;
            }
            }
            return(result);
        }
Exemplo n.º 16
0
        List <MessageRec> IFolder.LookupMessages(PropTag ptagToLookup, List <byte[]> keysToLookup, PropTag[] additionalPtagsToLoad)
        {
            if (ptagToLookup != PropTag.EntryId)
            {
                throw new NotImplementedException();
            }
            List <uint> list = new List <uint>(keysToLookup.Count);

            foreach (byte[] entryId in keysToLookup)
            {
                list.Add(PstMailbox.GetNodeIdFromEntryId(this.folder.PstMailbox.IPst.MessageStore.Guid, entryId));
            }
            List <MessageRec> list2 = new List <MessageRec>();

            this.EnumerateMessagesHelper(list, additionalPtagsToLoad, list2);
            return(list2);
        }
Exemplo n.º 17
0
        private static Restriction BuildTextRestriction(TextFilter filter, PropTag ptagToSearch, object propValue)
        {
            ContentFlags contentFlags;

            switch (filter.MatchOptions)
            {
            case MatchOptions.FullString:
                contentFlags = ContentFlags.FullString;
                break;

            case MatchOptions.SubString:
            case MatchOptions.Suffix:
            case MatchOptions.WildcardString:
                contentFlags = ContentFlags.SubString;
                break;

            case MatchOptions.Prefix:
                contentFlags = ContentFlags.Prefix;
                break;

            case MatchOptions.PrefixOnWords:
                contentFlags = ContentFlags.PrefixOnWords;
                break;

            case MatchOptions.ExactPhrase:
                contentFlags = ContentFlags.ExactPhrase;
                break;

            default:
                contentFlags = ContentFlags.FullString;
                break;
            }
            if ((filter.MatchFlags & MatchFlags.IgnoreCase) != MatchFlags.Default)
            {
                contentFlags |= ContentFlags.IgnoreCase;
            }
            if ((filter.MatchFlags & MatchFlags.IgnoreNonSpace) != MatchFlags.Default)
            {
                contentFlags |= ContentFlags.IgnoreNonSpace;
            }
            if ((filter.MatchFlags & MatchFlags.Loose) != MatchFlags.Default)
            {
                contentFlags |= ContentFlags.Loose;
            }
            return(Restriction.Content(ptagToSearch, propValue, contentFlags));
        }
Exemplo n.º 18
0
 ManifestCallbackStatus IMapiHierarchyManifestCallback.Change(PropValue[] props)
 {
     byte[] item = null;
     if (props != null)
     {
         foreach (PropValue propValue in props)
         {
             PropTag propTag = propValue.PropTag;
             if (propTag == PropTag.EntryId)
             {
                 item = propValue.GetBytes();
             }
         }
     }
     this.changes.ChangedFolders.Add(item);
     return(this.ReturnManifestCallbackStatus());
 }
Exemplo n.º 19
0
 private byte[] GetKeyPlusLMTHash(MessageRec mr, PropTag keyPtag, PropTag lmtPtag)
 {
     byte[] array = ((keyPtag == PropTag.EntryId) ? mr.EntryId : mr[keyPtag]) as byte[];
     if (array == null)
     {
         return(null);
     }
     if (this.conflictResolutionOption != ConflictResolutionOption.KeepAll)
     {
         return(array);
     }
     byte[] bytes  = BitConverter.GetBytes(FolderContentsMapper.GetDateTimeValue(mr, lmtPtag).ToBinary());
     byte[] array2 = new byte[array.Length + bytes.Length];
     array.CopyTo(array2, 0);
     bytes.CopyTo(array2, array.Length);
     return(array2);
 }
Exemplo n.º 20
0
 public object this[PropTag ptag]
 {
     get
     {
         if (this.additionalProps != null)
         {
             foreach (PropValueData propValueData in this.additionalProps)
             {
                 if (propValueData.PropTag == (int)ptag)
                 {
                     return(propValueData.Value);
                 }
             }
         }
         return(null);
     }
 }
Exemplo n.º 21
0
 protected static Restriction CreateORGuidContentRestriction(Guid[] values, PropTag propertyTag)
 {
     if (values.Length > 1)
     {
         Restriction[] array = new Restriction.PropertyRestriction[values.Length];
         for (int i = 0; i < values.Length; i++)
         {
             array[i] = Condition.CreatePropertyRestriction <Guid>(propertyTag, values[i]);
         }
         return(Restriction.Or(array));
     }
     if (values.Length == 1)
     {
         return(Condition.CreatePropertyRestriction <Guid>(propertyTag, values[0]));
     }
     return(null);
 }
Exemplo n.º 22
0
        internal override Restriction BuildRestriction()
        {
            PropTag propertyTag = base.Rule.PropertyDefinitionToPropTagFromCache(Rule.NamedDefinitions[1]);

            if (base.Text == null || base.Text.Length == 0)
            {
                return(Condition.CreatePropertyRestriction <bool>(propertyTag, true));
            }
            PropTag     propertyTag2 = base.Rule.PropertyDefinitionToPropTagFromCache(Rule.NamedDefinitions[2]);
            Restriction restriction  = (1 == base.Text.Length) ? Condition.CreatePropertyRestriction <string>(propertyTag2, base.Text[0]) : Condition.CreateAndStringPropertyRestriction(propertyTag2, base.Text);

            return(Condition.CreateAndRestriction(new Restriction[]
            {
                Condition.CreatePropertyRestriction <bool>(propertyTag, true),
                restriction
            }));
        }
 public virtual bool CompareSingleValue(PropTag tag, Restriction.RelOp op, object x, object y)
 {
     if (x == null)
     {
         return(y == null);
     }
     if (y == null)
     {
         return(false);
     }
     if (!RestrictionEvaluator.IsSupportedOperation(op))
     {
         throw new InvalidRuleException(string.Format("Operation {0} is not supported", op));
     }
     if (x.GetType() != y.GetType() && (!(x.GetType() == typeof(ExDateTime)) || !(y.GetType() == typeof(DateTime))))
     {
         throw new InvalidRuleException(string.Format("Can not compare values of type {0} and type {1}", x.GetType(), y.GetType()));
     }
     if (op == Restriction.RelOp.MemberOfDL)
     {
         byte[] array = x as byte[];
         if (array == null)
         {
             this.TraceDebug("CompareSingleValue: MemberOf, recipientEntryId is not a byte array.");
             this.RecordError(ServerStrings.FolderRuleErrorInvalidRecipientEntryId);
             return(false);
         }
         byte[] array2 = y as byte[];
         if (array2 == null)
         {
             this.TraceDebug("CompareSingleValue: MemberOf, groupEntryId is not a byte array, marking rule in error.");
             throw new InvalidRuleException(ServerStrings.FolderRuleErrorInvalidGroup(y.GetType().Name));
         }
         return(RuleUtil.IsMemberOf(this, array, array2));
     }
     else
     {
         int?num = RestrictionEvaluator.CompareValue(this.CultureInfo, tag, x, y);
         if (num == null)
         {
             throw new InvalidRuleException(string.Format("Can't compare value '{0}' and '{1}'", x, y));
         }
         return(RestrictionEvaluator.GetOperationResultFromOrder(op, num.Value));
     }
 }
Exemplo n.º 24
0
        protected override List <MessageRec> InternalLookupMessages(PropTag ptagToLookup, List <byte[]> keysToLookup, PropTag[] additionalPtagsToLoad)
        {
            ArgumentValidator.ThrowIfInvalidValue <PropTag>("ptagToLookup", ptagToLookup, (PropTag ptag) => ptag == PropTag.EntryId);
            List <string> list = new List <string>(keysToLookup.Count);

            foreach (byte[] entryId in keysToLookup)
            {
                list.Add(EasMailbox.GetStringId(entryId));
            }
            List <Fetch> fetchList = new List <Fetch>(keysToLookup.Count);

            CommonUtils.ProcessInBatches <string>(list.ToArray(), 10, delegate(string[] messageBatch)
            {
                ItemOperationsResponse itemOperationsResponse = this.Mailbox.EasConnectionWrapper.LookupItems(messageBatch, this.ServerId);
                fetchList.AddRange(itemOperationsResponse.Response.Fetches);
            });
            return(this.CreateMessageRecsForFetches(fetchList));
        }
Exemplo n.º 25
0
        List <MessageRec> IFolder.LookupMessages(PropTag ptagToLookup, List <byte[]> keysToLookup, PropTag[] additionalPtagsToLoad)
        {
            MrsTracer.Provider.Function("StorageFolder.LookupMessages: {0}", new object[]
            {
                this.DisplayNameForTracing
            });
            EntryIdMap <MessageRec> result = new EntryIdMap <MessageRec>();

            ItemQueryType[] array = new ItemQueryType[]
            {
                ItemQueryType.None,
                ItemQueryType.Associated
            };
            int capacity = 3 + ((additionalPtagsToLoad == null) ? 0 : additionalPtagsToLoad.Length);
            List <PropertyDefinition> columns = new List <PropertyDefinition>(capacity)
            {
                CoreObjectSchema.EntryId,
                CoreItemSchema.Size,
                CoreObjectSchema.CreationTime
            };
            int idxEntryId         = 0;
            int idxMessageSize     = 1;
            int idxCreationTime    = 2;
            int idxExtraProperties = 3;

            if (additionalPtagsToLoad != null && additionalPtagsToLoad.Length > 0)
            {
                columns.AddRange(this.Mailbox.ConvertPropTagsToDefinitions(additionalPtagsToLoad));
            }
            ItemQueryType[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                StorageFolder.< > c__DisplayClassb CS$ < > 8__locals2 = new StorageFolder.< > c__DisplayClassb();
                CS$ < > 8__locals2.queryType = array2[i];
                if (result.Count >= keysToLookup.Count)
                {
                    break;
                }
                bool doingFAI = CS$ < > 8__locals2.queryType == ItemQueryType.Associated;
                ExecutionContext.Create(new DataContext[]
                {
                    new OperationDataContext("StorageFolder.GetContentsTable", OperationType.None),
                    new SimpleValueDataContext("QueryType", CS$ < > 8__locals2.queryType)
                }).Execute(delegate
Exemplo n.º 26
0
 PropValueData[][] IFolder.GetACL(SecurityProp secProp)
 {
     if (!this.HasSecurityDescriptor(secProp))
     {
         return(null);
     }
     if (this.Mailbox.ServerVersion >= Server.E15MinVersion)
     {
         MrsTracer.Provider.Warning("MAPI provider does not support GetACL against E15+ mailboxes", new object[0]);
         return(null);
     }
     PropValueData[][] result;
     using (this.Mailbox.RHTracker.Start())
     {
         using (MapiModifyTable mapiModifyTable = (MapiModifyTable)this.Folder.OpenProperty(PropTag.AclTable, InterfaceIds.IExchangeModifyTable, 0, OpenPropertyFlags.DeferredErrors))
         {
             GetTableFlags getTableFlags = GetTableFlags.DeferredErrors;
             if (secProp == SecurityProp.FreeBusyNTSD)
             {
                 getTableFlags |= GetTableFlags.FreeBusy;
             }
             using (MapiTable table = mapiModifyTable.GetTable(getTableFlags))
             {
                 PropTag[] propTags = new PropTag[]
                 {
                     PropTag.EntryId,
                     PropTag.MemberId,
                     PropTag.MemberRights,
                     PropTag.MemberName
                 };
                 table.SeekRow(BookMark.Beginning, 0);
                 PropValue[][]     array  = MapiUtils.QueryAllRows(table, null, propTags);
                 PropValueData[][] array2 = new PropValueData[array.Length][];
                 int num = 0;
                 foreach (PropValue[] a in array)
                 {
                     array2[num++] = DataConverter <PropValueConverter, PropValue, PropValueData> .GetData(a);
                 }
                 result = array2;
             }
         }
     }
     return(result);
 }
Exemplo n.º 27
0
        internal static Restriction BuildIsReadRestriction(SinglePropertyFilter filter, IFilterBuilderHelper mapper)
        {
            ContentFilterSchema.ContentFilterPropertyDefinition contentFilterPropertyDefinition = (ContentFilterSchema.ContentFilterPropertyDefinition)filter.Property;
            PropTag propTagToSearch = contentFilterPropertyDefinition.PropTagToSearch;
            bool    flag;

            ContentFilterBuilder.CheckFilterIsEQorNE(filter, out flag);
            bool flag2 = (bool)ContentFilterBuilder.GetPropertyValue(filter);

            if (flag)
            {
                flag2 = !flag2;
            }
            if (!flag2)
            {
                return(Restriction.BitMaskZero(propTagToSearch, 1));
            }
            return(Restriction.BitMaskNonZero(propTagToSearch, 1));
        }
Exemplo n.º 28
0
        public static FolderRec Create(StoreSession storageSession, NativeStorePropertyDefinition[] definitions, object[] values)
        {
            PropValue[]        array      = new PropValue[definitions.Length];
            ICollection <uint> collection = PropertyTagCache.Cache.PropertyTagsFromPropertyDefinitions(storageSession, definitions);

            byte[] array2 = null;
            int    num    = 0;

            foreach (uint num2 in collection)
            {
                if (num2 == 268370178U)
                {
                    array2 = storageSession.IdConverter.GetLongTermIdFromId(storageSession.IdConverter.GetFidFromId(StoreObjectId.FromProviderSpecificId((byte[])values[num])));
                }
                num++;
            }
            num = 0;
            foreach (uint num3 in collection)
            {
                object  obj     = values[num];
                PropTag propTag = (PropTag)num3;
                if (propTag == PropTag.LTID)
                {
                    obj = array2;
                }
                if (obj == null)
                {
                    propTag = propTag.ChangePropType(PropType.Null);
                }
                else if (obj is PropertyError)
                {
                    propTag = propTag.ChangePropType(PropType.Error);
                    obj     = (int)((PropertyError)obj).PropertyErrorCode;
                }
                else if (obj is ExDateTime)
                {
                    obj = (DateTime)((ExDateTime)obj);
                }
                array[num] = new PropValue(propTag, obj);
                num++;
            }
            return(FolderRec.Create(storageSession, array));
        }
Exemplo n.º 29
0
    /// <summary>
    /// 生成磁铁
    /// </summary>
    public void GreatMagnet()
    {
        if (GameMode.Instance.Magnets.Count > 0)
        {
            nowChilderProp = GameMode.Instance.Magnets[0];
            nowChilderProp.SetActive(true);
            nowChilderProp.transform.position = transform.position + transform.up * 1.5f;
            GameMode.Instance.Magnets.RemoveAt(0);
        }
        else
        {
            nowChilderProp = Instantiate(GameMode.Instance.Magnet, transform.position + transform.up * 1.5f, transform.rotation);
        }
        var magentCollider = nowChilderProp.GetComponent <MagnetCollider>();

        magentCollider.nowParent = gameObject;
        magentCollider.nowPos    = transform.position + transform.up * 1.5f;
        magentCollider.ChangeMagnetPos();
        nowProp = PropTag.Magnet;                         //磁铁标识
    }
Exemplo n.º 30
0
 protected PropValue[] FromMapiPropValueToXsoPropValue(PropValue[] propValues)
 {
     PropTag[] array = new PropTag[propValues.Length];
     for (int i = 0; i < propValues.Length; i++)
     {
         array[i] = propValues[i].PropTag;
     }
     NativeStorePropertyDefinition[] array2 = PropertyTagCache.Cache.PropertyDefinitionsFromPropTags(NativeStorePropertyDefinition.TypeCheckingFlag.DisableTypeCheck, this.MapiFolder, this.Session, array);
     PropValue[] array3 = new PropValue[propValues.Length];
     for (int j = 0; j < array2.Length; j++)
     {
         if (array2[j] == null)
         {
             throw new NotSupportedException(string.Format("The property tag cannot be resolved to a property definition. PropertyTag = {0}", array[j]));
         }
         object valueFromPropValue = MapiPropertyBag.GetValueFromPropValue(this.Session, CoreObject.GetPersistablePropertyBag(this.folder).ExTimeZone, array2[j], propValues[j]);
         array3[j] = new PropValue(array2[j], valueFromPropValue);
     }
     return(array3);
 }