private void SetProperty(IProperties properties, WiaProperty property, object propValue) { Debug(string.Format("Try to set property '{0}' to value '{1}'", property, propValue)); var propName = ((int)property).ToString(); IProperty prop; try { prop = properties.get_Item(propName); } catch (Exception e) { Debug(string.Format("Error occured when getting property '{0}': " + e, property)); throw; } try { prop.set_Value(ref propValue); } catch (Exception e) { Debug(string.Format("Error occured when setting property '{0}': " + e, property)); throw; } Debug(string.Format("Property '{0}' was successfully setted", property)); }
private static Property FindProperty(WIA.Properties properties, WiaProperty property) { foreach (Property prop in properties) { if (prop.PropertyID == (int)property) { return(prop); } } return(null); }
public static void SetProperty(WIA.Properties properties, WiaProperty propertyId, object value) { foreach(WIA.Property property in properties) { if(property.PropertyID == (int)propertyId) { property.set_Value(value); break; } } }
private Property FindProperty(WIA.Properties properties, WiaProperty property) { Log("Try to find property: " + property); foreach (Property prop in properties) { if (prop.PropertyID == (int)property) { Log(string.Format("Property '{0}' was found", property)); return(prop); } } Log(string.Format("Property '{0}' was not found", property)); return(null); }
public static object GetProperty(WIA.Properties properties, WiaProperty propertyId) { object result = null; foreach(WIA.Property property in properties) { if(property.PropertyID == (int)propertyId) { result = property.get_Value(); break; } } return result; }
private static Property FindProperty(WIA.Properties properties, WiaProperty property) { foreach (Property prop in properties) { if (prop.PropertyID == (int)property) { return prop; } } return null; }
public void InitializeProperty(WiaProperty property, dynamic val) { PropertyValues.Add((uint)property, val); }
private void SetProperty(IProperties properties, WiaProperty property, object propValue) { Debug(string.Format("Try to set property '{0}' to value '{1}'",property, propValue)); var propName = ((int)property).ToString(); IProperty prop; try { prop = properties.get_Item(propName); } catch (Exception e) { Debug(string.Format("Error occured when getting property '{0}': " + e, property)); throw; } try { prop.set_Value(ref propValue); } catch (Exception e) { Debug(string.Format("Error occured when setting property '{0}': " + e, property)); throw; } Debug(string.Format("Property '{0}' was successfully setted", property)); }
private Property FindProperty(WIA.Properties properties, WiaProperty property) { Log("Try to find property: " + property); foreach (Property prop in properties) { if (prop.PropertyID == (int)property) { Log(string.Format("Property '{0}' was found", property)); return prop; } } Log(string.Format("Property '{0}' was not found", property)); return null; }