コード例 #1
0
        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)
            {
            }
        }
コード例 #2
0
ファイル: Folder.cs プロジェクト: zhonghai66/pstsdknet
 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);
 }
コード例 #3
0
ファイル: Pst.cs プロジェクト: zhonghai66/pstsdknet
 public NodeID GetNodeID(PropId propId)
 {
     if (_propBag.PropertyExists(propId))
     {
         return(GetNodeID(_propBag.ReadProperty(propId)));
     }
     else
     {
         return(0);
     }
 }
コード例 #4
0
ファイル: NameIdMap.cs プロジェクト: zhonghai66/pstsdknet
        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);
        }
コード例 #5
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));
        }
コード例 #6
0
ファイル: Message.cs プロジェクト: zhonghai66/pstsdknet
 public byte[] ReadProperty(PropId id)
 {
     return(_propBag.ReadProperty(id));
 }