コード例 #1
0
        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));
        }
コード例 #2
0
 private static Property FindProperty(WIA.Properties properties, WiaProperty property)
 {
     foreach (Property prop in properties)
     {
         if (prop.PropertyID == (int)property)
         {
             return(prop);
         }
     }
     return(null);
 }
コード例 #3
0
 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;
     }
   }
 }
コード例 #4
0
 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);
 }
コード例 #5
0
      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;
      }
コード例 #6
0
		private static Property FindProperty(WIA.Properties properties, WiaProperty property)
		{
			foreach (Property prop in properties)
			{
				if (prop.PropertyID == (int)property)
				{
					return prop;
				}
			}
			return null;
		}
コード例 #7
0
 public void InitializeProperty(WiaProperty property, dynamic val)
 {
     PropertyValues.Add((uint)property, val);
 }
コード例 #8
0
ファイル: WiaSource.cs プロジェクト: UNIT6-open/TWAIN-Web
		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));
		}
コード例 #9
0
ファイル: WiaSource.cs プロジェクト: UNIT6-open/TWAIN-Web
		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;
		}