protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { object value = propertyBag.GetValue(InternalSchema.MapiInternetCpid); if (value is int && (int)value == 20127) { string valueOrDefault = propertyBag.GetValueOrDefault <string>(InternalSchema.ItemClass); if (ObjectClass.IsOfClass(valueOrDefault, "IPM.InfoPathForm")) { return(28591); } } return(value); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { byte[][] array = propertyBag.GetValue(this.enclosedPropertyDefinition) as byte[][]; if (array != null) { StoreObjectId[] array2 = new StoreObjectId[array.Length]; for (int i = 0; i < array.Length; i++) { array2[i] = StoreObjectId.FromProviderSpecificId(array[i], StoreObjectType.Unknown); } return array2; } return new PropertyError(this, PropertyErrorCode.NotFound); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { object obj = ExtendedFolderFlagsProperty.DecodeFolderFlags(propertyBag.GetValue(InternalSchema.ExtendedFolderFlagsInternal)); if (!(obj is ExtendedFolderFlagsProperty.ParsedFlags)) { return(obj); } ExtendedFolderFlagsProperty.ParsedFlags parsedFlags = (ExtendedFolderFlagsProperty.ParsedFlags)obj; if (parsedFlags.ContainsKey(this.flag)) { return((ExtendedFolderFlags)BitConverter.ToInt32(parsedFlags[this.flag], 0)); } return(new PropertyError(this, PropertyErrorCode.NotFound)); }
protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value) { CalendarItemBase calendarItemBase = propertyBag.Context.StoreObject as CalendarItemBase; if (calendarItemBase != null) { calendarItemBase.LocationIdentifierHelperInstance.SetLocationIdentifier(42869U, LastChangeAction.ModifyReminder); } propertyBag.SetValueWithFixup(InternalSchema.ReminderDueByInternal, value); if (ObjectClass.IsMessage(propertyBag.GetValue(InternalSchema.ItemClass) as string, false)) { propertyBag.SetValueWithFixup(InternalSchema.ReplyTime, (ExDateTime)value); } Reminder.Adjust(propertyBag.Context.StoreObject); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { object obj = propertyBag.GetValue(this.predictedActionsProperty); if (!(obj is PropertyError)) { short[] array = (short[])obj; int num = array.Length; PredictedActionAndProbability[] array2 = new PredictedActionAndProbability[num]; for (int i = 0; i < num; i++) { array2[i] = new PredictedActionAndProbability(array[i]); } obj = array2; } return obj; }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { foreach (ContactEmailSlotParticipantProperty propertyDefinition in PrimarySmtpAddressProperty.sourceProps) { Participant participant = propertyBag.GetValue(propertyDefinition) as Participant; if (participant != null && participant.RoutingType == "EX") { string text = participant.TryGetProperty(ParticipantSchema.SmtpAddress) as string; if (!string.IsNullOrEmpty(text)) { return(text); } } } return(new PropertyError(this, PropertyErrorCode.NotFound)); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { MessageItem messageItem = propertyBag.Context.StoreObject as MessageItem; if (messageItem == null) { return(propertyBag.GetValue(InternalSchema.MapiLikersBlob)); } object blob = ((Likers)messageItem.Likers).Blob; if (blob == null) { return(new PropertyError(this, PropertyErrorCode.NotFound)); } return(blob); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { MessageItem messageItem = propertyBag.Context.StoreObject as MessageItem; if (messageItem == null) { return(propertyBag.GetValue(InternalSchema.MapiReplyToNames)); } object names = ((ReplyTo)messageItem.ReplyTo).Names; if (names == null) { return(new PropertyError(this, PropertyErrorCode.NotFound)); } return(names); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { object value = propertyBag.GetValue(InternalSchema.FolderWebViewInfo); if (PropertyError.IsPropertyNotFound(value)) { return(value); } byte[] webViewInfo = PropertyBag.CheckPropertyValue <byte[]>(InternalSchema.FolderWebViewInfo, value); object result; try { result = FolderHomePageUrlProperty.GetUrlFromWebViewInfo(webViewInfo); } catch (CorruptDataException ex) { result = new PropertyError(this, PropertyErrorCode.CorruptedData, ex.Message); } return(result); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { byte[] array = propertyBag.GetValue(this.propertyDefinition) as byte[]; if (array == null) { SecurityDescriptorProperty.Tracer.TraceError((long)this.GetHashCode(), "SecurityDescriptorProperty::InternalTryGetValue. Security descriptor is missing."); return(null); } if (array.Length <= 8) { SecurityDescriptorProperty.Tracer.TraceError <int>((long)this.GetHashCode(), "SecurityDescriptorProperty::InternalTryGetValue. Security descriptor has invalid length: {0}.", array.Length); return(null); } int num = (int)BitConverter.ToUInt16(array, 2); if (num != 3) { SecurityDescriptorProperty.Tracer.TraceError <int, ArrayTracer <byte> >((long)this.GetHashCode(), "SecurityDescriptorProperty::InternalTryGetValue. Security descriptor has unknown version: {0}. Bytes={1}.", num, new ArrayTracer <byte>(array)); return(null); } int num2 = (int)BitConverter.ToUInt16(array, 0); if (num2 < 8) { SecurityDescriptorProperty.Tracer.TraceError <int, ArrayTracer <byte> >((long)this.GetHashCode(), "SecurityDescriptorProperty::InternalTryGetValue. Security descriptor offset is less than 8 bytes: {0}. Bytes={1}.", num2, new ArrayTracer <byte>(array)); return(null); } object result; try { result = new RawSecurityDescriptor(array, num2); } catch (ArgumentException arg) { SecurityDescriptorProperty.Tracer.TraceError <ArrayTracer <byte>, ArgumentException>((long)this.GetHashCode(), "SecurityDescriptorProperty::InternalTryGetValue. Byte array for the RawSecurityDescritor is not valid. Bytes={0}. Exception = {1}.", new ArrayTracer <byte>(array), arg); result = null; } return(result); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { MessageItem messageItem = propertyBag.Context.StoreObject as MessageItem; CalendarItemBase calendarItemBase = propertyBag.Context.StoreObject as CalendarItemBase; if (messageItem != null) { return(this.BuildAggregatedValue <Recipient>(messageItem.Recipients)); } if (calendarItemBase != null) { return(this.BuildAggregatedValue <Attendee>(calendarItemBase.AttendeeCollection)); } if (this.storeComputedProperty != null) { object value = propertyBag.GetValue(this.storeComputedProperty); if (!PropertyError.IsPropertyError(value)) { return(value); } } return(new PropertyError(this, PropertyErrorCode.GetCalculatedPropertyError)); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { object obj = ExtendedFolderFlagsProperty.DecodeFolderFlags(propertyBag.GetValue(InternalSchema.ExtendedFolderFlagsInternal)); ExtendedFolderFlagsProperty.ParsedFlags parsedFlags = obj as ExtendedFolderFlagsProperty.ParsedFlags; if (parsedFlags != null) { byte[] b; if (parsedFlags.TryGetValue(ExtendedFolderFlagsProperty.FlagTag.Clsid, out b)) { try { return(new Guid(b)); } catch (ArgumentException) { return(new PropertyError(this, PropertyErrorCode.CorruptedData)); } } return(new PropertyError(this, PropertyErrorCode.NotFound)); } return(obj); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyStore) { StoreObjectId storeObjectId = null; ICoreObject coreObject = propertyStore.Context.CoreObject; if (coreObject != null) { storeObjectId = coreObject.InternalStoreObjectId; } if (storeObjectId == null) { byte[] array = propertyStore.GetValue(InternalSchema.EntryId) as byte[]; if (array != null) { storeObjectId = StoreObjectId.FromProviderSpecificId(array, this.GetStoreObjectType(propertyStore)); } else { QueryResultPropertyBag queryResultPropertyBag = ((PropertyBag)propertyStore) as QueryResultPropertyBag; if (queryResultPropertyBag != null && (!((IDirectPropertyBag)queryResultPropertyBag).IsLoaded(InternalSchema.RowType) || object.Equals(queryResultPropertyBag.TryGetProperty(InternalSchema.RowType), 1))) { ExDiagnostics.FailFast(string.Format("EntryId: \"{0}\" in view", queryResultPropertyBag.TryGetProperty(InternalSchema.EntryId)), false); } } } if (storeObjectId == null) { return(new PropertyError(this, PropertyErrorCode.NotFound)); } VersionedId versionedId = new VersionedId(storeObjectId, this.GetChangeKey(propertyStore)); if (!this.IsCompatibleId(versionedId, coreObject)) { return(new PropertyError(this, PropertyErrorCode.NotSupported)); } return(versionedId); }
private bool IsSuppressed(PropertyBag.BasicPropertyStore propertyBag) { int num; return(Util.TryConvertTo <int>(propertyBag.GetValue(InternalSchema.AutoResponseSuppressInternal), out num) && (num & (int)this.suppressMask) == (int)this.suppressMask); }
protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value) { ExtendedFolderFlagsProperty.ParsedFlags parsedFlags = ExtendedFolderFlagsProperty.DecodeFolderFlags(propertyBag.GetValue(InternalSchema.ExtendedFolderFlagsInternal)) as ExtendedFolderFlagsProperty.ParsedFlags; if (parsedFlags == null) { parsedFlags = new ExtendedFolderFlagsProperty.ParsedFlags(); } parsedFlags[this.flag] = BitConverter.GetBytes((int)value); propertyBag.SetValueWithFixup(InternalSchema.ExtendedFolderFlagsInternal, ExtendedFolderFlagsProperty.EncodeFolderFlags(parsedFlags)); }
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); } }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { return(propertyBag.GetValue(this.nativeProp)); }
private bool CanExtractReplyTo(PropertyBag.BasicPropertyStore propertyBag) { string text = propertyBag.GetValue(InternalSchema.ItemClass) as string; return(!string.IsNullOrEmpty(text) && ObjectClass.IsMessage(text, false)); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { return(propertyBag.GetValue(InternalSchema.AppointmentStateInternal)); }
private static bool GetFlagValue(PropertyBag.BasicPropertyStore propertyBag, NativeStorePropertyDefinition prop, int flag) { int num; return(Util.TryConvertTo <int>(propertyBag.GetValue(prop), out num) && (num & flag) == flag); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { return(propertyBag.GetValue(this.aggregatedProperty)); }
private static bool CanExtractRecipients(PropertyBag.BasicPropertyStore propertyBag) { string itemClass = propertyBag.GetValue(InternalSchema.ItemClass) as string; return(ComplexParticipantExtractorBase <T> .CanExtractRecipients(itemClass)); }
protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value) { byte[] value2 = ((Guid)value).ToByteArray(); ExtendedFolderFlagsProperty.ParsedFlags parsedFlags = ExtendedFolderFlagsProperty.DecodeFolderFlags(propertyBag.GetValue(InternalSchema.ExtendedFolderFlagsInternal)) as ExtendedFolderFlagsProperty.ParsedFlags; if (parsedFlags == null) { parsedFlags = new ExtendedFolderFlagsProperty.ParsedFlags(); } parsedFlags[ExtendedFolderFlagsProperty.FlagTag.Clsid] = value2; propertyBag.SetValueWithFixup(InternalSchema.ExtendedFolderFlagsInternal, ExtendedFolderFlagsProperty.EncodeFolderFlags(parsedFlags)); }
protected virtual byte[] GetChangeKey(PropertyBag.BasicPropertyStore propertyBag) { return((propertyBag.GetValue(InternalSchema.ChangeKey) as byte[]) ?? Array <byte> .Empty); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { StoreSession session = propertyBag.Context.Session; if (session == null) { ExTraceGlobals.StorageTracer.TraceDebug((long)propertyBag.GetHashCode(), "ReminderDueByProperty: StoreObject is not present and the property bag is not a QueryResultsPropertyBag. First should be present when accessing a property on an object, and the second one - when called from a view. All other cases are wrong."); return(propertyBag.GetValue(InternalSchema.ReminderDueByInternal)); } PropertyError result = new PropertyError(InternalSchema.ReminderDueBy, PropertyErrorCode.GetCalculatedPropertyError); CalendarItem calendarItem = propertyBag.Context.StoreObject as CalendarItem; InternalRecurrence internalRecurrence = null; if (calendarItem != null) { try { internalRecurrence = (InternalRecurrence)calendarItem.Recurrence; goto IL_206; } catch (RecurrenceFormatException ex) { ExTraceGlobals.StorageTracer.TraceDebug <string, StoreObjectId>((long)session.GetHashCode(), "Unable to parse recurrence info. Using the stored value for DueBy.\r\n\tError: {0}\r\n\tID:{1}", ex.Message, (calendarItem.Id != null) ? calendarItem.Id.ObjectId : null); return(result); } catch (CorruptDataException ex2) { ExTraceGlobals.StorageTracer.TraceDebug <string, StoreObjectId>((long)session.GetHashCode(), "Unable to parse the organizer timezone. Using the stored value for DueBy.\r\n\tError: {0}\r\n\tID:{1}", ex2.Message, (calendarItem.Id != null) ? calendarItem.Id.ObjectId : null); return(result); } } byte[] entryId; if (Util.TryConvertTo <byte[]>(propertyBag.GetValue(InternalSchema.EntryId), out entryId)) { VersionedId versionedId = new VersionedId(StoreObjectId.FromProviderSpecificId(entryId), Array <byte> .Empty); byte[] array = propertyBag.GetValue(InternalSchema.AppointmentRecurrenceBlob) as byte[]; if (array != null) { string valueOrDefault = propertyBag.GetValueOrDefault <string>(InternalSchema.TimeZone, string.Empty); byte[] valueOrDefault2 = propertyBag.GetValueOrDefault <byte[]>(InternalSchema.TimeZoneBlob); byte[] valueOrDefault3 = propertyBag.GetValueOrDefault <byte[]>(InternalSchema.TimeZoneDefinitionRecurring); ExTimeZone timeZoneFromProperties = TimeZoneHelper.GetTimeZoneFromProperties(valueOrDefault, valueOrDefault2, valueOrDefault3); if (timeZoneFromProperties == null) { ExTraceGlobals.StorageTracer.TraceDebug <string, StoreObjectId>((long)session.GetHashCode(), "Unable to parse the organizer timezone. Using the stored value for DueBy.\r\n\tError: {0}\r\n\tID:{1}", "organizerTimeZone is null", versionedId.ObjectId); return(result); } try { internalRecurrence = InternalRecurrence.GetRecurrence(versionedId, session, array, timeZoneFromProperties, CalendarItem.DefaultCodePage); } catch (RecurrenceFormatException ex3) { ExTraceGlobals.StorageTracer.TraceDebug <string, StoreObjectId>((long)session.GetHashCode(), "Unable to parse recurrence info. Using the stored value for DueBy.\r\n\tError: {0}\r\n\tID:{1}", ex3.Message, versionedId.ObjectId); return(result); } catch (CorruptDataException ex4) { ExTraceGlobals.StorageTracer.TraceDebug <string, StoreObjectId>((long)session.GetHashCode(), "Unable to parse the organizer timezone. Using the stored value for DueBy.\r\n\tError: {0}\r\n\tID:{1}", ex4.Message, versionedId.ObjectId); return(result); } } } IL_206: bool defaultIsSet; int defaultMinutesBeforeStart; ExDateTime value; if (internalRecurrence == null || !Util.TryConvertTo <bool>(propertyBag.GetValue(InternalSchema.ReminderIsSetInternal), out defaultIsSet) || !Util.TryConvertTo <int>(propertyBag.GetValue(InternalSchema.ReminderMinutesBeforeStartInternal), out defaultMinutesBeforeStart) || !Util.TryConvertTo <ExDateTime>(propertyBag.GetValue(InternalSchema.ReminderNextTime), out value)) { return(propertyBag.GetValue(InternalSchema.ReminderDueByInternal)); } ExDateTime probeTime = Reminder.GetProbeTime(Reminder.GetTimeNow(session.ExTimeZone), new ExDateTime?(value)); OccurrenceInfo mostRecentOccurrence; try { mostRecentOccurrence = CalendarItem.CustomReminder.GetMostRecentOccurrence(internalRecurrence, probeTime, defaultIsSet, defaultMinutesBeforeStart); } catch (CorruptDataException) { return(result); } if (mostRecentOccurrence == null) { return(new PropertyError(this, PropertyErrorCode.NotFound)); } return(mostRecentOccurrence.StartTime); }
protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value) { StartTimeProperty.SetCalendarTime(propertyBag, InternalSchema.MapiEndTime, InternalSchema.MapiPREndDate, InternalSchema.TimeZoneDefinitionEnd, true, value); EndTimeProperty.DenormalizeTimeProperty(propertyBag, (ExDateTime)propertyBag.GetValue(InternalSchema.MapiEndTime), InternalSchema.MapiEndTime, InternalSchema.MapiPREndDate); }
protected override StoreObjectType GetStoreObjectType(PropertyBag.BasicPropertyStore propertyBag) { return(ObjectClass.GetObjectType(propertyBag.GetValue(InternalSchema.ItemClass) as string)); }
protected override void InternalSetValue(PropertyBag.BasicPropertyStore propertyBag, object value) { if (propertyBag.CanIgnoreUnchangedProperties && (base.PropertyFlags & PropertyFlags.SetIfNotChanged) != PropertyFlags.SetIfNotChanged && propertyBag.IsLoaded(this) && Util.ValueEquals(value, propertyBag.GetValue(this))) { return; } propertyBag.SetValue(this, value); }
protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { return(propertyBag.GetValue(InternalSchema.AutoResponseSuppressInternal)); }
protected IParticipant GetSimpleParticipant(SmartPropertyDefinition definition, PropertyBag.BasicPropertyStore propertyBag) { return(propertyBag.GetValue(definition) as IParticipant); }