/// <summary> /// Utility function which updates the value of a PropertyBinary. (Not intended for external use) /// </summary> /// <remarks>If the property value has changed and the properties are not locked (PropertiesLock() /// called more recently than PropertiesUnlock()), publication of an update is scheduled</remarks> /// <param name="aProperty">Property to be updated</param> /// <param name="aValue">New value for the property</param> /// <returns>true if the property's value has changed (aValue was different to the previous value)</returns> protected bool SetPropertyBinary(PropertyBinary aProperty, byte[] aValue) { uint changed; int err; GCHandle h = GCHandle.Alloc(aValue, GCHandleType.Pinned); err = DvProviderSetPropertyBinary(iHandle, aProperty.Handle(), h.AddrOfPinnedObject(), (uint)aValue.Length, out changed); h.Free(); if (err != 0) { throw new PropertyUpdateError(); } return(changed != 0); }
/// <summary> /// Utility function which updates the value of a PropertyBinary. (Not intended for external use) /// </summary> /// <remarks>If the property value has changed and the properties are not locked (PropertiesLock() /// called more recently than PropertiesUnlock()), publication of an update is scheduled</remarks> /// <param name="aProperty">Property to be updated</param> /// <param name="aValue">New value for the property</param> /// <returns>true if the property's value has changed (aValue was different to the previous value)</returns> protected unsafe bool SetPropertyBinary(PropertyBinary aProperty, byte[] aValue) { uint changed; int err; fixed(byte *pValue = aValue) { err = DvProviderSetPropertyBinary(iHandle, aProperty.Handle(), pValue, (uint)aValue.Length, &changed); } if (err != 0) { throw new PropertyUpdateError(); } return(changed != 0); }