예제 #1
0
        public Subnode GetObjectProperty(PropertyID propertyID)
        {
            PtypObjectRecord objRecord = GetObjectRecordProperty(propertyID);
            Subnode          subnode   = m_subnodeBTree.GetSubnode(objRecord.Nid);

            return(subnode);
        }
예제 #2
0
        public void SetObjectProperty(PropertyID propertyID, NodeID subnodeID, int size)
        {
            PtypObjectRecord objRecord = new PtypObjectRecord(subnodeID, (uint)size);

            byte[] propertyBytes = objRecord.GetBytes();

            SetExternalProperty(propertyID, PropertyTypeName.PtypObject, propertyBytes);
        }
예제 #3
0
        public PtypObjectRecord GetObjectRecordProperty(PropertyID propertyID)
        {
            PropertyContextRecord record = GetRecordByPropertyID(propertyID);

            if (record != null)
            {
                if (record.wPropType == PropertyTypeName.PtypObject)
                {
                    if (record.IsExternal)
                    {
                        if (record.IsHeapID)
                        {
                            byte[]           buffer    = this.GetHeapItem(record.HeapID);
                            PtypObjectRecord objRecord = new PtypObjectRecord(buffer);
                            return(objRecord);
                        }
                        else
                        {
                            throw new InvalidPropertyException("Unexpected object record");
                        }
                    }
                    else
                    {
                        // this should never happen
                        throw new InvalidPropertyException("Unexpected record data type found");
                    }
                }
                else
                {
                    throw new InvalidPropertyException("Unexpected PC data type found");
                }
            }
            else
            {
                return(null);
            }
        }