Created
October 1, 2018 00:05
-
-
Save abfo/ccf6e573fc25e479c2d16461618558ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SetDeviceIntProperty(ref Device device, int propertyID, int propertyValue) | |
{ | |
foreach (Property p in device.Properties) | |
{ | |
if (p.PropertyID == propertyID) | |
{ | |
object value = propertyValue; | |
p.set_Value(ref value); | |
break; | |
} | |
} | |
} | |
private int GetDeviceIntProperty(ref Device device, int propertyID) | |
{ | |
int ret = -1; | |
foreach (Property p in device.Properties) | |
{ | |
if (p.PropertyID == propertyID) | |
{ | |
ret = (int)p.get_Value(); | |
break; | |
} | |
} | |
return ret; | |
} | |
private void SetItemIntProperty(ref Item item, int propertyID, int propertyValue) | |
{ | |
foreach (Property p in item.Properties) | |
{ | |
if (p.PropertyID == propertyID) | |
{ | |
object value = propertyValue; | |
p.set_Value(ref value); | |
break; | |
} | |
} | |
} | |
private int GetItemIntProperty(ref Item item, int propertyID) | |
{ | |
int ret = -1; | |
foreach (Property p in item.Properties) | |
{ | |
if (p.PropertyID == propertyID) | |
{ | |
ret = (int)p.get_Value(); | |
break; | |
} | |
} | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment