internal ExtractedNaturalLanguageProperty(string displayName, NativeStorePropertyDefinition xmlExtractedProperty) : base(displayName, typeof(TExtraction[]), PropertyFlags.None, PropertyDefinitionConstraint.None, new PropertyDependency[]
 {
     new PropertyDependency(xmlExtractedProperty, PropertyDependencyType.NeedForRead)
 })
 {
     this.xmlExtractedProperty = xmlExtractedProperty;
 }
 internal ReminderAdjustmentProperty(string displayName, NativeStorePropertyDefinition nativeProp) : base(displayName, nativeProp.Type, PropertyFlags.None, PropertyDefinitionConstraint.None, new PropertyDependency[]
 {
     new PropertyDependency(nativeProp, PropertyDependencyType.NeedForRead)
 })
 {
     this.nativeProp = nativeProp;
 }
 internal ActivityObjectIdProperty(string propertyName, NativeStorePropertyDefinition backingPropertyDefinition) : base(propertyName, typeof(StoreObjectId), PropertyFlags.None, PropertyDefinitionConstraint.None, new PropertyDependency[]
 {
     new PropertyDependency(backingPropertyDefinition, PropertyDependencyType.NeedForRead)
 })
 {
     this.backingPropertyDefinition = backingPropertyDefinition;
 }
Exemple #4
0
            private TnefPropertyTag StartProperty(NativeStorePropertyDefinition property)
            {
                this.CheckStartTnefAttribute();
                this.streamProperty = null;
                TnefPropertyTag tnefPropertyTag;

                switch (property.SpecifiedWith)
                {
                case PropertyTypeSpecifier.PropertyTag:
                    tnefPropertyTag = ItemToTnefConverter.TnefContentWriter.GetTnefPropertyTag((PropertyTagPropertyDefinition)property);
                    this.tnefWriter.StartProperty(tnefPropertyTag);
                    break;

                case PropertyTypeSpecifier.GuidString:
                {
                    GuidNamePropertyDefinition guidNamePropertyDefinition = (GuidNamePropertyDefinition)property;
                    tnefPropertyTag = ItemToTnefConverter.TnefContentWriter.GetTnefPropertyTag(guidNamePropertyDefinition);
                    this.tnefWriter.StartProperty(tnefPropertyTag, guidNamePropertyDefinition.Guid, guidNamePropertyDefinition.PropertyName);
                    break;
                }

                case PropertyTypeSpecifier.GuidId:
                {
                    GuidIdPropertyDefinition guidIdPropertyDefinition = (GuidIdPropertyDefinition)property;
                    tnefPropertyTag = ItemToTnefConverter.TnefContentWriter.GetTnefPropertyTag(guidIdPropertyDefinition);
                    this.tnefWriter.StartProperty(tnefPropertyTag, guidIdPropertyDefinition.Guid, guidIdPropertyDefinition.Id);
                    break;
                }

                default:
                    throw new InvalidOperationException(string.Format("Invalid native property specifier: {0}", property.SpecifiedWith));
                }
                return(tnefPropertyTag);
            }
Exemple #5
0
        public override Stream OpenPropertyStream(PropertyDefinition propertyDefinition, PropertyOpenMode openMode)
        {
            base.CheckDisposed("OpenPropertyStream");
            EnumValidator.AssertValid <PropertyOpenMode>(openMode);
            NativeStorePropertyDefinition nativeStorePropertyDefinition = propertyDefinition as NativeStorePropertyDefinition;

            if (nativeStorePropertyDefinition == null)
            {
                throw new InvalidOperationException(ServerStrings.ExPropertyNotStreamable(propertyDefinition.ToString()));
            }
            Stream result;

            using (DisposeGuard disposeGuard = default(DisposeGuard))
            {
                StoreObjectStream storeObjectStream = new StoreObjectStream(this, nativeStorePropertyDefinition, openMode);
                disposeGuard.Add <StoreObjectStream>(storeObjectStream);
                this.listOfStreams.Add(storeObjectStream);
                disposeGuard.Success();
                if (openMode == PropertyOpenMode.Create || openMode == PropertyOpenMode.Modify)
                {
                    this.TrackProperty(nativeStorePropertyDefinition, true);
                }
                result = storeObjectStream;
            }
            return(result);
        }
 public void PromoteProperty(AbstractInboundConverter converter, NativeStorePropertyDefinition property)
 {
     if (converter.CurrentComponentType == this.targetComponentType)
     {
         converter.PromoteProperty(property, true);
     }
 }
Exemple #7
0
        public PropertyBag[] QueryAttachmentTable(NativeStorePropertyDefinition[] properties)
        {
            this.CheckDisposed(null);
            if (this.savedAttachmentList.Count == 0)
            {
                return(null);
            }
            Dictionary <StorePropertyDefinition, int> propertyPositionsDictionary = QueryResultPropertyBag.CreatePropertyPositionsDictionary(properties);

            PropertyBag[] array = new PropertyBag[this.savedAttachmentList.Count];
            int           num   = 0;

            foreach (KeyValuePair <int, PersistablePropertyBag> keyValuePair in this.savedAttachmentList)
            {
                keyValuePair.Value[AttachmentSchema.AttachNum] = keyValuePair.Key;
                object[] array2 = new object[properties.Length];
                for (int num2 = 0; num2 != properties.Length; num2++)
                {
                    NativeStorePropertyDefinition propertyDefinition = properties[num2];
                    array2[num2] = ((IDirectPropertyBag)keyValuePair.Value).GetValue(propertyDefinition);
                }
                QueryResultPropertyBag queryResultPropertyBag = new QueryResultPropertyBag(null, propertyPositionsDictionary);
                queryResultPropertyBag.ExTimeZone = this.ExTimeZone;
                queryResultPropertyBag.ReturnErrorsOnTruncatedProperties = true;
                queryResultPropertyBag.SetQueryResultRow(array2);
                array[num++] = queryResultPropertyBag;
            }
            return(array);
        }
 public void PromoteProperty(AbstractInboundConverter converter, NativeStorePropertyDefinition property)
 {
     if ((property.PropertyFlags & PropertyFlags.ReadOnly) != PropertyFlags.ReadOnly)
     {
         converter.PromoteProperty(property, true);
     }
 }
 public void PromoteProperty(AbstractInboundConverter converter, NativeStorePropertyDefinition definition)
 {
     if (converter.CurrentComponentType == ConversionComponentType.Message)
     {
         converter.PromoteAddressProperty(definition);
     }
 }
        internal static void ResolveAndFilterPropertyValues(NativeStorePropertyDefinition.TypeCheckingFlag typeCheckingFlag, StoreSession storeSession, MapiProp mapiProp, ExTimeZone exTimeZone, PropValue[] mapiPropValues, out NativeStorePropertyDefinition[] propertyDefinitions, out PropTag[] mapiPropTags, out object[] propertyValues)
        {
            PropTag[] array = new PropTag[mapiPropValues.Length];
            for (int i = 0; i < mapiPropValues.Length; i++)
            {
                array[i] = mapiPropValues[i].PropTag;
            }
            int num;

            NativeStorePropertyDefinition[] array2 = PropertyTagCache.Cache.InternalPropertyDefinitionsFromPropTags(typeCheckingFlag, mapiProp, storeSession, array, out num);
            propertyDefinitions = new NativeStorePropertyDefinition[num];
            mapiPropTags        = new PropTag[num];
            propertyValues      = new object[num];
            int num2 = 0;

            for (int j = 0; j < array2.Length; j++)
            {
                if (array2[j] != null)
                {
                    object valueFromPropValue = MapiPropertyBag.GetValueFromPropValue(storeSession, exTimeZone, array2[j], mapiPropValues[j]);
                    propertyDefinitions[num2] = array2[j];
                    mapiPropTags[num2]        = PropTagHelper.PropTagFromIdAndType(array[j].Id(), array2[j].MapiPropertyType);
                    propertyValues[num2]      = valueFromPropValue;
                    num2++;
                }
            }
        }
        private void WriteProperty(NativeStorePropertyDefinition property, object value)
        {
            value = ExTimeZoneHelperForMigrationOnly.ToLegacyUtcIfDateTime(value);
            switch (property.SpecifiedWith)
            {
            case PropertyTypeSpecifier.PropertyTag:
            {
                PropertyTagPropertyDefinition propertyTagPropertyDefinition = (PropertyTagPropertyDefinition)property;
                TnefPropertyTag propertyTag = (int)propertyTagPropertyDefinition.PropertyTag;
                this.PropertyWriter.WriteProperty(propertyTag, value);
                return;
            }

            case PropertyTypeSpecifier.GuidString:
            {
                GuidNamePropertyDefinition guidNamePropertyDefinition = (GuidNamePropertyDefinition)property;
                TnefPropertyType           propertyType = (TnefPropertyType)guidNamePropertyDefinition.MapiPropertyType;
                this.PropertyWriter.WriteProperty(guidNamePropertyDefinition.Guid, guidNamePropertyDefinition.PropertyName, propertyType, value);
                return;
            }

            case PropertyTypeSpecifier.GuidId:
            {
                GuidIdPropertyDefinition guidIdPropertyDefinition = (GuidIdPropertyDefinition)property;
                TnefPropertyType         propertyType2            = (TnefPropertyType)guidIdPropertyDefinition.MapiPropertyType;
                this.PropertyWriter.WriteProperty(guidIdPropertyDefinition.Guid, guidIdPropertyDefinition.Id, propertyType2, value);
                return;
            }

            default:
                throw new InvalidOperationException(string.Format("Invalid native property specifier: {0}", property.SpecifiedWith));
            }
        }
Exemple #12
0
 internal ReadonlySmartProperty(NativeStorePropertyDefinition propertyDefinition) : base(propertyDefinition.Name, propertyDefinition.Type, PropertyFlags.ReadOnly, PropertyDefinitionConstraint.None, new PropertyDependency[]
 {
     new PropertyDependency(propertyDefinition, PropertyDependencyType.NeedForRead)
 })
 {
     this.enclosedProperty = propertyDefinition;
 }
Exemple #13
0
 public TagAction(uint userFlags, NativeStorePropertyDefinition propertyDefinition, object propertyValue) : base(RuleActionType.Tag, userFlags)
 {
     Util.ThrowOnNullArgument(propertyDefinition, "propertyDefinition");
     Util.ThrowOnNullArgument(propertyValue, "propertyValue");
     this.PropertyDefinition = propertyDefinition;
     this.PropertyValue      = propertyValue;
 }
        internal NativeStorePropertyDefinition[] InternalPropertyDefinitionsFromPropTags(NativeStorePropertyDefinition.TypeCheckingFlag propertyTypeCheckingFlag, MapiProp mapiProp, StoreSession storeSession, PropTag[] propTags, out int resolvedPropertyCount)
        {
            EnumValidator.ThrowIfInvalid <NativeStorePropertyDefinition.TypeCheckingFlag>(propertyTypeCheckingFlag, "propertyTypeCheckingFlag");
            resolvedPropertyCount = 0;
            NativeStorePropertyDefinition[] array = new NativeStorePropertyDefinition[propTags.Length];
            List <PropertyTagCache.NamedPropertyToResolve> list = null;

            PropTag[] array2 = null;
            for (int i = 0; i < propTags.Length; i++)
            {
                PropTag propTag = propTags[i];
                if (!PropertyTagCache.TryFixPropTagWithErrorType(storeSession, mapiProp, ref array2, ref propTag))
                {
                    ExTraceGlobals.PropertyMappingTracer.TraceError <PropTag>((long)storeSession.GetHashCode(), "Failed to infer the property type for PropertyTag {0:X}", propTag);
                }
                else
                {
                    PropertyTagCache.ChangeStringPropTagTypeToUnicode(ref propTag);
                    int num = propTag.Id();
                    if (num < 32768)
                    {
                        NativeStorePropertyDefinition nativeStorePropertyDefinition = PropertyTagPropertyDefinition.InternalCreateCustom(string.Empty, propTag, PropertyFlags.None, propertyTypeCheckingFlag);
                        array[i] = nativeStorePropertyDefinition;
                        if (nativeStorePropertyDefinition != null)
                        {
                            resolvedPropertyCount++;
                        }
                    }
                    else
                    {
                        if (list == null)
                        {
                            list = new List <PropertyTagCache.NamedPropertyToResolve>();
                        }
                        list.Add(new PropertyTagCache.NamedPropertyToResolve((ushort)num, propTag.ValueType(), i));
                    }
                }
            }
            if (list != null)
            {
                NamedProp[] namedPropsFromIds = NamedPropConverter.GetNamedPropsFromIds(storeSession, mapiProp, from namedPropertyToResolve in list
                                                                                        select namedPropertyToResolve.PropId);
                int num2 = 0;
                foreach (PropertyTagCache.NamedPropertyToResolve namedPropertyToResolve2 in list)
                {
                    NativeStorePropertyDefinition propDefByMapiNamedProp = PropertyTagCache.GetPropDefByMapiNamedProp(namedPropsFromIds[num2++], namedPropertyToResolve2.PropType, propertyTypeCheckingFlag);
                    array[namedPropertyToResolve2.Index] = propDefByMapiNamedProp;
                    if (propDefByMapiNamedProp != null)
                    {
                        resolvedPropertyCount++;
                    }
                    else
                    {
                        ExTraceGlobals.PropertyMappingTracer.TraceDebug <ushort, PropType>((long)storeSession.GetHashCode(), "Failed to resolve a named property from PropertyId {0:X} [{1:X}]", namedPropertyToResolve2.PropId, namedPropertyToResolve2.PropType);
                    }
                }
            }
            return(array);
        }
		internal PredictedActionsProperty(string displayName, NativeStorePropertyDefinition predictedActionsProperty, PropertyFlags propertyFlags) : base(displayName, typeof(PredictedActionAndProbability[]), propertyFlags, PropertyDefinitionConstraint.None, new PropertyDependency[]
		{
			new PropertyDependency(predictedActionsProperty, PropertyDependencyType.AllRead)
		})
		{
			Util.ThrowOnNullArgument(predictedActionsProperty, "predictedActionsProperty");
			this.predictedActionsProperty = predictedActionsProperty;
		}
        private SortOrder GetSortOrder(MapiTable table, SortBy[] sortColumns, GroupByAndOrder[] groupBy, int expandCount, ref List <PropTag> alteredProperties)
        {
            if ((sortColumns == null || sortColumns.Length == 0) && (groupBy == null || groupBy.Length == 0))
            {
                return(null);
            }
            SortOrder sortOrder = new SortOrder();

            if (groupBy != null)
            {
                for (int i = 0; i < groupBy.Length; i++)
                {
                    NativeStorePropertyDefinition nativeGroupBy = InternalSchema.ToStorePropertyDefinition(groupBy[i].GroupByColumn).GetNativeGroupBy();
                    PropTag   sortPropertyTag  = this.GetSortPropertyTag(nativeGroupBy, ref alteredProperties);
                    GroupSort nativeGroupSort  = InternalSchema.ToStorePropertyDefinition(groupBy[i].GroupSortColumn.ColumnDefinition).GetNativeGroupSort(groupBy[i].GroupSortColumn.SortOrder, groupBy[i].GroupSortColumn.Aggregate);
                    PropTag   sortPropertyTag2 = this.GetSortPropertyTag((NativeStorePropertyDefinition)nativeGroupSort.ColumnDefinition, ref alteredProperties);
                    SortFlags sortFlag;
                    switch (nativeGroupSort.Aggregate)
                    {
                    case Aggregate.Min:
                        sortFlag = SortFlags.CategoryMin;
                        break;

                    case Aggregate.Max:
                        sortFlag = SortFlags.CategoryMax;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException("groupBy", nativeGroupSort.Aggregate, ServerStrings.ExInvalidAggregate);
                    }
                    sortOrder.AddCategory(sortPropertyTag, QueryExecutor.SortOrderToSortFlags(nativeGroupSort.SortOrder));
                    if (sortPropertyTag != sortPropertyTag2)
                    {
                        sortOrder.Add(sortPropertyTag2, sortFlag);
                    }
                }
                sortOrder.ExpandCount = expandCount;
            }
            if (sortOrder.GetSortCount() > 4)
            {
                throw new ArgumentException(ServerStrings.ExTooComplexGroupSortParameter, "groupBy");
            }
            if (sortColumns != null && sortColumns.Length > 0)
            {
                SortBy[] nativeSortBy = QueryExecutor.GetNativeSortBy(sortColumns);
                if (nativeSortBy.Length + sortOrder.GetSortCount() > 6)
                {
                    throw new ArgumentOutOfRangeException("sortColumns", ServerStrings.ExTooManySortColumns);
                }
                for (int j = 0; j < nativeSortBy.Length; j++)
                {
                    PropertyDefinition columnDefinition = nativeSortBy[j].ColumnDefinition;
                    PropTag            sortPropertyTag3 = this.GetSortPropertyTag((NativeStorePropertyDefinition)columnDefinition, ref alteredProperties);
                    sortOrder.Add(sortPropertyTag3, QueryExecutor.SortOrderToSortFlags(nativeSortBy[j].SortOrder));
                }
            }
            return(sortOrder);
        }
Exemple #17
0
        protected override ReadOnlyCollection <NativeStorePropertyDefinition> GetEmailSlotProperties()
        {
            ICollection <NativeStorePropertyDefinition> emailSlotProperties = base.GetEmailSlotProperties();

            NativeStorePropertyDefinition[] array = new NativeStorePropertyDefinition[emailSlotProperties.Count + 1];
            emailSlotProperties.CopyTo(array, 0);
            array[emailSlotProperties.Count] = this.faxPropDef;
            return(new ReadOnlyCollection <NativeStorePropertyDefinition>(array));
        }
        private void WriteRecipientProperty(ConversionRecipientEntry recipient, NativeStorePropertyDefinition property)
        {
            object obj = recipient.TryGetProperty(property);

            if (!PropertyError.IsPropertyError(obj))
            {
                this.WriteProperty(property, obj);
            }
        }
 protected AbstractInboundConverter.IPromotionRule GetPropertyPromotionRule(NativeStorePropertyDefinition property)
 {
     AbstractInboundConverter.IPromotionRule result = null;
     if (this.rules.TryGetValue(property, out result))
     {
         return(result);
     }
     return(this.defaultPromotionRule);
 }
 internal AutoResponseRequestProperty(string displayName, NativeStorePropertyDefinition nativeProp) : base(displayName, nativeProp.Type, PropertyFlags.Sortable, PropertyDefinitionConstraint.None, new PropertyDependency[]
 {
     new PropertyDependency(nativeProp, PropertyDependencyType.NeedForRead),
     new PropertyDependency(InternalSchema.AutoResponseSuppressInternal, PropertyDependencyType.NeedToReadForWrite)
 })
 {
     this.nativeProp   = nativeProp;
     this.suppressMask = AutoResponseSuppressProperty.SuppressionMapping[nativeProp];
 }
Exemple #21
0
 private static void SetOrDeleteValue(IStorePropertyBag propertyBag, NativeStorePropertyDefinition property, string value)
 {
     if (value == null)
     {
         propertyBag.Delete(property);
         return;
     }
     propertyBag[property] = value;
 }
 private static void SetOrDeleteValue(IStorePropertyBag propertyBag, NativeStorePropertyDefinition property, LocationSource value)
 {
     if (value == Microsoft.Exchange.Data.Storage.LocationSource.None)
     {
         propertyBag.Delete(property);
         return;
     }
     propertyBag[property] = value;
 }
 private static void SetOrDeleteValue <T>(IStorePropertyBag propertyBag, NativeStorePropertyDefinition property, T?value) where T : struct
 {
     if (value == null)
     {
         propertyBag.Delete(property);
         return;
     }
     propertyBag[property] = value.Value;
 }
Exemple #24
0
 internal TaskDate(string displayName, NativeStorePropertyDefinition firstProperty, NativeStorePropertyDefinition secondProperty) : base(displayName, typeof(ExDateTime), PropertyFlags.None, PropertyDefinitionConstraint.None, new PropertyDependency[]
 {
     new PropertyDependency(firstProperty, PropertyDependencyType.NeedForRead),
     new PropertyDependency(secondProperty, PropertyDependencyType.NeedForRead)
 })
 {
     this.first  = firstProperty;
     this.second = secondProperty;
 }
 protected AggregateRecipientProperty(string displayName, NativeStorePropertyDefinition storeComputedProperty, StorePropertyDefinition recipientStringProperty) : base(displayName, typeof(string), PropertyFlags.ReadOnly, PropertyDefinitionConstraint.None, (storeComputedProperty != null) ? new PropertyDependency[]
 {
     new PropertyDependency(storeComputedProperty, PropertyDependencyType.NeedForRead)
 } : Array <PropertyDependency> .Empty)
 {
     this.storeComputedProperty   = storeComputedProperty;
     this.recipientStringProperty = recipientStringProperty;
     this.RegisterFilterTranslation();
 }
Exemple #26
0
        internal static bool IsPropertyTransmittable(NativeStorePropertyDefinition property)
        {
            if (property is NamedPropertyDefinition)
            {
                return(true);
            }
            PropertyTagPropertyDefinition propertyTagPropertyDefinition = (PropertyTagPropertyDefinition)property;

            return(propertyTagPropertyDefinition.IsTransmittable);
        }
Exemple #27
0
        internal bool IsItemPropertyWritable(NativeStorePropertyDefinition property)
        {
            bool result = false;

            if (this.messagePropertyExceptions.TryGetValue(property, out result))
            {
                return(result);
            }
            return(!this.IsExtensionCustomProperty(property) && this.DefaultPropertyCheck(property));
        }
Exemple #28
0
 internal StoreObjectStream(StoreObjectPropertyBag storePropertyBag, NativeStorePropertyDefinition property, PropertyOpenMode streamOpenMode)
 {
     Util.ThrowOnNullArgument(storePropertyBag, "storePropertyBag");
     Util.ThrowOnNullArgument(property, "property");
     this.storePropertyBag = storePropertyBag;
     this.property         = property;
     this.openMode         = streamOpenMode;
     this.CreateStream();
     this.disposeTracker = this.GetDisposeTracker();
 }
Exemple #29
0
        internal bool IsAttachmentPropertyWritable(NativeStorePropertyDefinition property)
        {
            bool result = false;

            if (TnefPropertyChecker.attachmentPropertyTransmittabilities.TryGetValue(property, out result))
            {
                return(result);
            }
            return(this.DefaultPropertyCheck(property));
        }
Exemple #30
0
        protected override NativeStorePropertyDefinition GetSortProperty()
        {
            NativeStorePropertyDefinition sortProperty = this.sortByAndFilterStrategy.GetSortProperty();

            if (sortProperty == null)
            {
                return(base.GetSortProperty());
            }
            return(sortProperty);
        }