protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag) { object obj = base.InternalTryGetValue(propertyBag); if (PropertyError.IsPropertyError(obj)) { return(obj); } return(FileAsStringProperty.TranslateMarkup((string)obj, "{0} ({1})") ?? new PropertyError(this, PropertyErrorCode.NotFound)); }
protected override string GenerateCompositePropertyValue(PropertyBag.BasicPropertyStore propertyBag) { FileAsMapping fileAsMapping = (FileAsMapping)((propertyBag.GetValue(InternalSchema.FileAsId) as int?) ?? -1); if (fileAsMapping == FileAsMapping.None || !EnumValidator.IsValidValue <FileAsMapping>(fileAsMapping)) { return((propertyBag.GetValue(InternalSchema.FileAsStringInternal) as string) ?? string.Empty); } return(FileAsStringProperty.GenerateFileAsString(propertyBag, FileAsStringProperty.FileAsPatterns[fileAsMapping])); }
internal void UpdateFullNameAndSubject(PropertyBag propertyBag) { StoreSession session = propertyBag.Context.Session; FormattedSentence formattedSentence = new FormattedSentence((session != null) ? FileAsStringProperty.GetContactFullNameFormat().ToString(session.InternalPreferedCulture) : FileAsStringProperty.GetContactFullNameFormat()); FormattedSentence formattedSentence2 = new FormattedSentence((session != null) ? FileAsStringProperty.GetContactSubjectFormat().ToString(session.InternalPreferedCulture) : FileAsStringProperty.GetContactSubjectFormat()); PropertyBag.BasicPropertyStore propertyBag2 = (PropertyBag.BasicPropertyStore)propertyBag; if (base.IsAtomOrRulePropertyDirty(propertyBag2)) { if (!propertyBag.IsPropertyDirty(InternalSchema.DisplayName)) { propertyBag[InternalSchema.DisplayName] = FileAsStringProperty.TranslateMarkup(FileAsStringProperty.GenerateFileAsString(propertyBag2, formattedSentence), "{0} - {1}"); } if (!propertyBag.IsPropertyDirty(InternalSchema.MapiSubject)) { propertyBag[InternalSchema.Subject] = FileAsStringProperty.TranslateMarkup(FileAsStringProperty.GenerateFileAsString(propertyBag2, formattedSentence2), "{0} - {1}"); } } }
internal FileAsStringProperty(NativeStorePropertyDefinition compositeProperty) : base("FileAsStringProperty", compositeProperty, FileAsStringProperty.GetAtomAndRuleProperties()) { }