private void lvProperties_SelectedIndexChanged(object sender, EventArgs e) { if (lvProperties.SelectedItems.Count < 1) { return; } try { try { PropId prop = ((IPropertyInformation)lvProperties.SelectedItems[0].Tag).PropertyId; var bytes = _propertyObject.ReadProperty(prop); var byteProvider = new DynamicByteProvider(bytes); hexBox1.ByteProvider = byteProvider; } catch (InvalidCastException) { var prop = (PropId)lvProperties.SelectedItems[0].Tag; var bytes = _propertyObject.ReadProperty(prop); var byteProvider = new DynamicByteProvider(bytes); hexBox1.ByteProvider = byteProvider; } } catch (Exception) { } }
public EntryID GetDraftsFolderEntryId() { return (_propBag.PropertyExists(PropId.KnownValue.PR_IPM_DRAFTS_ENTRYID) ? new EntryID() { Value = _propBag.ReadProperty(PropId.KnownValue.PR_IPM_DRAFTS_ENTRYID) } : EntryID.Empty); }
public NodeID GetNodeID(PropId propId) { if (_propBag.PropertyExists(propId)) { return(GetNodeID(_propBag.ReadProperty(propId))); } else { return(0); } }
public NameIdMap(IDBAccessor database) { _database = database; _propBag = database.GetPropertyObjectByNodeId((uint)NodeID.Predefined.nid_name_id_map); BucketCount = BitConverter.ToInt32(_propBag.ReadProperty(PropId.KnownValue.PidTagNameidBucketCount), 0); }
/// <summary> /// Performs default encoding behaviour.. if the property is typed as 'prop_type_string' it's decoded with Encoding.Default, otherwise it uses Unicode (UCS16 LE)... /// <para>This is not always desired, but works most of the time.</para> /// </summary> /// <param name="propBag"></param> /// <param name="propID"></param> /// <returns></returns> public static string GetStringProperty(IPropertyObject propBag, PropId propID) { var propType = propBag.GetPropertyType(propID); byte[] bytes = propBag.ReadProperty(propID); if (propType != PropertyType.KnownValue.prop_type_wstring && propType != PropertyType.KnownValue.prop_type_string) { throw new ArgumentException("Invalid Property Type"); } return (propType == PropertyType.KnownValue.prop_type_string ? PropertyHelper.GetEncodedStringProperty(bytes, Encoding.UTF8) : PropertyHelper.GetUnicodeStringProperty(bytes)); }
public byte[] ReadProperty(PropId id) { return(_propBag.ReadProperty(id)); }