Exemplo n.º 1
0
        public Nullable <double> GetFloat64Property(PropertyID propertyID)
        {
            PropertyContextRecord record = GetRecordByPropertyID(propertyID);

            if (record != null)
            {
                if (record.wPropType == PropertyTypeName.PtypFloating64)
                {
                    if (!record.HeapOrNodeID.IsEmpty)
                    {
                        byte[] floatBytes = this.GetHeapItem(record.HeapID);
                        double result     = LittleEndianConverter.ToFloat64(floatBytes, 0);
                        return(result);
                    }
                    else
                    {
                        // The hid is set to zero if the data item is empty
                        return(null);
                    }
                }
                else
                {
                    throw new InvalidPropertyException("Unexpected PC data type found");
                }
            }
            else
            {
                return(null);
            }
        }