本文整理汇总了C#中OpenHome.Net.Core.PropertyString.Handle方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyString.Handle方法的具体用法?C# PropertyString.Handle怎么用?C# PropertyString.Handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenHome.Net.Core.PropertyString
的用法示例。
在下文中一共展示了PropertyString.Handle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPropertyString
/// <summary>
/// Utility function which updates the value of a PropertyString. (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.
///
/// Throws ParameterValidationError if the property has a range of allowed values and
/// the new value is not in this range</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 SetPropertyString(PropertyString aProperty, String aValue)
{
uint changed;
IntPtr value = InteropUtils.StringToHGlobalUtf8(aValue);
int err = DvProviderSetPropertyString(iHandle, aProperty.Handle(), value, &changed);
Marshal.FreeHGlobal(value);
if (err != 0)
{
throw new PropertyUpdateError();
}
return (changed != 0);
}