Ejemplo n.º 1
0
        protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value)
        {
            string text = value as string;

            if (text == null)
            {
                throw new ArgumentNullException("value");
            }
            SubjectProperty.ModifySubjectProperty(propertyBag, this.nativeProperty, text);
        }
Ejemplo n.º 2
0
        internal static bool TruncateSubject(PropertyBag propertyBag, int limit)
        {
            bool   result = false;
            string text   = propertyBag.TryGetProperty(InternalSchema.Subject) as string;

            if (text != null && SubjectProperty.TruncateSubject(ref text, limit))
            {
                SubjectProperty.ModifySubjectProperty((PropertyBag.BasicPropertyStore)propertyBag, InternalSchema.MapiSubject, text);
                result = true;
            }
            return(result);
        }
Ejemplo n.º 3
0
        protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            string text  = (string)value;
            string text2 = propertyBag.GetValue(InternalSchema.SubjectPrefixInternal) as string;
            string text3 = propertyBag.GetValue(InternalSchema.NormalizedSubjectInternal) as string;

            if (text2 != null && text3 != null && text == text2 + text3)
            {
                return;
            }
            string propertyValue;
            string text4;

            SubjectProperty.ComputeSubjectPrefix(text, out propertyValue, out text4);
            propertyBag.SetValueWithFixup(InternalSchema.SubjectPrefixInternal, propertyValue);
            propertyBag.SetValueWithFixup(InternalSchema.NormalizedSubjectInternal, text4);
            propertyBag.SetValueWithFixup(InternalSchema.MapiSubject, text);
            if (text4 != text3)
            {
                MessageItem messageItem = propertyBag.Context.StoreObject as MessageItem;
                if (messageItem != null)
                {
                    string itemClass = propertyBag.GetValue(InternalSchema.ItemClass) as string;
                    if (!ObjectClass.IsPost(itemClass))
                    {
                        messageItem.ConversationTopic = text4;
                        if (!string.IsNullOrEmpty(text3))
                        {
                            messageItem.ConversationIndex = ConversationIndex.CreateNew().ToByteArray();
                            if (messageItem.MessageResponseType == MessageResponseType.None)
                            {
                                SubjectProperty.ClearReplyForwardProperties(messageItem);
                                return;
                            }
                        }
                        else if (messageItem.GetValueOrDefault <byte[]>(InternalSchema.ConversationIndex) == null)
                        {
                            messageItem.ConversationIndex = ConversationIndex.CreateNew().ToByteArray();
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        internal static void QuerySubjectContains(Folder folder, string subject, string schemaKey, ICollection <PropertyDefinition> propertiesToFetch, bool useCachedPropertySetIfPresent, Action <PropertyBag> matchFoundAction, ExDateTime startDate, ExDateTime endDate)
        {
            string normalizedSubject;
            string text;

            SubjectProperty.ComputeSubjectPrefix(subject, out text, out normalizedSubject);
            CalendarCorrelationMatch.QueryItemsUsingView(folder, new SortBy[]
            {
                new SortBy(InternalSchema.OriginalLastModifiedTime, SortOrder.Descending)
            }, null, CalendarCorrelationMatch.GetPropertySet(schemaKey, propertiesToFetch, useCachedPropertySetIfPresent), delegate(PropertyBag propertyBag)
            {
                string text2 = propertyBag.GetValueOrDefault <string>(InternalSchema.NormalizedSubject);
                if (string.IsNullOrEmpty(text2))
                {
                    text2 = string.Empty;
                }
                if (text2.IndexOf(normalizedSubject, StringComparison.CurrentCultureIgnoreCase) != -1 && CalendarCorrelationMatch.MatchOriginalLastModifiedTime(propertyBag, new ExDateTime?(startDate), new ExDateTime?(endDate)))
                {
                    matchFoundAction(propertyBag);
                }
                return(true);
            });
        }
Ejemplo n.º 5
0
 internal void SetSubjectProperty(NativeStorePropertyDefinition property, string value)
 {
     this.CheckDisposed("SetSubjectProperty");
     SubjectProperty.ModifySubjectProperty(CoreObject.GetPersistablePropertyBag(this.coreItem), property, value);
 }
Ejemplo n.º 6
0
 internal static void TruncateSubject(Item item, int limit)
 {
     SubjectProperty.TruncateSubject(item.PropertyBag, limit);
 }
Ejemplo n.º 7
0
        internal static void ModifySubjectProperty(PropertyBag.BasicPropertyStore item, NativeStorePropertyDefinition property, string value)
        {
            string text  = item.GetValue(InternalSchema.SubjectPrefixInternal) as string;
            string text2 = item.GetValue(InternalSchema.NormalizedSubjectInternal) as string;
            string text3 = item.GetValue(InternalSchema.MapiSubject) as string;

            if (property == InternalSchema.NormalizedSubjectInternal)
            {
                text2 = value;
                if (text3 != null)
                {
                    string text4 = SubjectProperty.ExtractPrefixUsingNormalizedSubject(text3, text2);
                    if (text4 != null)
                    {
                        text = text4;
                    }
                }
                if (text == null)
                {
                    text = string.Empty;
                }
            }
            else if (property == InternalSchema.SubjectPrefixInternal)
            {
                text = value;
                if (text3 != null && text3.StartsWith(text, StringComparison.Ordinal))
                {
                    text2 = text3.Substring(text.Length);
                }
                if (text2 == null)
                {
                    text2 = string.Empty;
                }
            }
            else
            {
                if (property != InternalSchema.MapiSubject)
                {
                    throw new ArgumentException("Not a supported subject property", "property");
                }
                if (!string.IsNullOrEmpty(text) && value.StartsWith(text, StringComparison.Ordinal))
                {
                    text2 = value.Substring(text.Length);
                }
                else if (!string.IsNullOrEmpty(text2))
                {
                    string text5 = SubjectProperty.ExtractPrefixUsingNormalizedSubject(value, text2);
                    if (text5 != null)
                    {
                        text = text5;
                    }
                    else
                    {
                        SubjectProperty.ComputeSubjectPrefix(value, out text, out text2);
                    }
                }
                else
                {
                    SubjectProperty.ComputeSubjectPrefix(value, out text, out text2);
                }
            }
            text3 = text + text2;
            item.SetValueWithFixup(InternalSchema.SubjectPrefixInternal, text);
            item.SetValueWithFixup(InternalSchema.NormalizedSubjectInternal, text2);
            item.SetValueWithFixup(InternalSchema.MapiSubject, text3);
            string itemClass = item.GetValue(InternalSchema.ItemClass) as string;

            if (!ObjectClass.IsPost(itemClass))
            {
                item.SetValueWithFixup(InternalSchema.ConversationTopic, text2);
            }
        }
Ejemplo n.º 8
0
 internal static void ModifySubjectProperty(PropertyBag propertyBag, NativeStorePropertyDefinition property, string value)
 {
     SubjectProperty.ModifySubjectProperty((PropertyBag.BasicPropertyStore)propertyBag, property, value);
 }
Ejemplo n.º 9
0
 internal static void ModifySubjectProperty(Item item, NativeStorePropertyDefinition property, string value)
 {
     SubjectProperty.ModifySubjectProperty(item.PropertyBag, property, value);
 }