Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
[SharpDX] Rename SharpDX.Win32.PropertyKey to PropertyBagKey
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Mar 11, 2013
1 parent 6b54bf2 commit 48eba7b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions Source/SharpDX.Direct2D1/WIC/BitmapEncoderOptions.cs
Expand Up @@ -51,7 +51,7 @@ public float ImageQuality
get { return Get(ImageQualityKey); }
set { Set(ImageQualityKey, value);}
}
private static readonly PropertyKey<float, float> ImageQualityKey = new PropertyKey<float, float>("ImageQuality");
private static readonly PropertyBagKey<float, float> ImageQualityKey = new PropertyBagKey<float, float>("ImageQuality");

/// <summary>
/// Gets or sets the compression quality.
Expand All @@ -68,7 +68,7 @@ public float CompressionQuality
get { return Get(CompressionQualityKey); }
set { Set(CompressionQualityKey, value); }
}
private static readonly PropertyKey<float, float> CompressionQualityKey = new PropertyKey<float, float>("CompressionQuality");
private static readonly PropertyBagKey<float, float> CompressionQualityKey = new PropertyBagKey<float, float>("CompressionQuality");

/// <summary>
/// Gets or sets a value indicating whether loss less compression is enabled.
Expand All @@ -85,7 +85,7 @@ public bool LossLess
get { return Get(LosslessKey); }
set { Set(LosslessKey, value); }
}
private static readonly PropertyKey<bool, bool> LosslessKey = new PropertyKey<bool, bool>("Lossless");
private static readonly PropertyBagKey<bool, bool> LosslessKey = new PropertyBagKey<bool, bool>("Lossless");

/// <summary>
/// Gets or sets the bitmap transform.
Expand All @@ -102,7 +102,7 @@ public BitmapTransformOptions BitmapTransform
get { return Get(BitmapTransformKey); }
set { Set(BitmapTransformKey, value); }
}
private static readonly PropertyKey<BitmapTransformOptions, byte> BitmapTransformKey = new PropertyKey<BitmapTransformOptions, byte>("BitmapTransform");
private static readonly PropertyBagKey<BitmapTransformOptions, byte> BitmapTransformKey = new PropertyBagKey<BitmapTransformOptions, byte>("BitmapTransform");

/// <summary>
/// Gets or sets a value indicating whether [interlace option].
Expand All @@ -119,7 +119,7 @@ public bool InterlaceOption
get { return Get(InterlaceOptionKey); }
set { Set(InterlaceOptionKey, value); }
}
private static readonly PropertyKey<bool, bool> InterlaceOptionKey = new PropertyKey<bool, bool>("InterlaceOption");
private static readonly PropertyBagKey<bool, bool> InterlaceOptionKey = new PropertyBagKey<bool, bool>("InterlaceOption");

/// <summary>
/// Gets or sets the filter option.
Expand All @@ -136,7 +136,7 @@ public PngFilterOption FilterOption
get { return Get(FilterOptionKey); }
set { Set(FilterOptionKey, value); }
}
private static readonly PropertyKey<PngFilterOption, byte> FilterOptionKey = new PropertyKey<PngFilterOption, byte>("FilterOption");
private static readonly PropertyBagKey<PngFilterOption, byte> FilterOptionKey = new PropertyBagKey<PngFilterOption, byte>("FilterOption");

/// <summary>
/// Gets or sets the TIFF compression method.
Expand All @@ -153,7 +153,7 @@ public TiffCompressionOption TiffCompressionMethod
get { return Get(TiffCompressionMethodKey); }
set { Set(TiffCompressionMethodKey, value); }
}
private static readonly PropertyKey<TiffCompressionOption, bool> TiffCompressionMethodKey = new PropertyKey<TiffCompressionOption, bool>("TiffCompressionMethod");
private static readonly PropertyBagKey<TiffCompressionOption, bool> TiffCompressionMethodKey = new PropertyBagKey<TiffCompressionOption, bool>("TiffCompressionMethod");

/// <summary>
/// Gets or sets the luminance.
Expand All @@ -170,7 +170,7 @@ public uint[] Luminance
get { return Get(LuminanceKey); }
set { Set(LuminanceKey, value); }
}
private static readonly PropertyKey<uint[], uint[]> LuminanceKey = new PropertyKey<uint[], uint[]>("Luminance");
private static readonly PropertyBagKey<uint[], uint[]> LuminanceKey = new PropertyBagKey<uint[], uint[]>("Luminance");

/// <summary>
/// Gets or sets the chrominance.
Expand All @@ -187,7 +187,7 @@ public uint[] Chrominance
get { return Get(ChrominanceKey); }
set { Set(ChrominanceKey, value); }
}
private static readonly PropertyKey<uint[], uint[]> ChrominanceKey = new PropertyKey<uint[], uint[]>("Chrominance");
private static readonly PropertyBagKey<uint[], uint[]> ChrominanceKey = new PropertyBagKey<uint[], uint[]>("Chrominance");

/// <summary>
/// Gets or sets the JPEG Y cr cb subsampling.
Expand All @@ -204,7 +204,7 @@ public JpegYCrCbSubsamplingOption JpegYCrCbSubsampling
get { return Get(JpegYCrCbSubsamplingKey); }
set { Set(JpegYCrCbSubsamplingKey, value); }
}
private static readonly PropertyKey<JpegYCrCbSubsamplingOption, byte> JpegYCrCbSubsamplingKey = new PropertyKey<JpegYCrCbSubsamplingOption, byte>("JpegYCrCbSubsampling");
private static readonly PropertyBagKey<JpegYCrCbSubsamplingOption, byte> JpegYCrCbSubsamplingKey = new PropertyBagKey<JpegYCrCbSubsamplingOption, byte>("JpegYCrCbSubsampling");

/// <summary>
/// Gets or sets a value indicating whether [suppress app0].
Expand All @@ -221,6 +221,6 @@ public bool SuppressApp0
get { return Get(SuppressApp0Key); }
set { Set(SuppressApp0Key, value); }
}
private static readonly PropertyKey<bool, bool> SuppressApp0Key = new PropertyKey<bool, bool>("SuppressApp0");
private static readonly PropertyBagKey<bool, bool> SuppressApp0Key = new PropertyBagKey<bool, bool>("SuppressApp0");
}
}
2 changes: 1 addition & 1 deletion Source/SharpDX/SharpDX.csproj
Expand Up @@ -188,7 +188,7 @@
<Compile Include="Win32\PropertyBag.cs" />
<Compile Include="Win32\IStream.cs" />
<Compile Include="Win32\IStreamBase.cs" />
<Compile Include="Win32\PropertyKey.cs" />
<Compile Include="Win32\PropertyBagKey.cs" />
<Compile Include="Win32\ComStringEnumerator.cs" />
<Compile Include="Win32\SecurityAttributes.cs" />
<Compile Include="Win32\Variant.cs" />
Expand Down
8 changes: 4 additions & 4 deletions Source/SharpDX/Win32/PropertyBag.cs
Expand Up @@ -109,13 +109,13 @@ public object Get(string name)
}

/// <summary>
/// Gets the value of the property by using a <see cref="PropertyKey{T1,T2}"/>
/// Gets the value of the property by using a <see cref="PropertyBagKey{T1,T2}"/>
/// </summary>
/// <typeparam name="T1">The public type of this property.</typeparam>
/// <typeparam name="T2">The marshaling type of this property.</typeparam>
/// <param name="propertyKey">The property key.</param>
/// <returns>Value of the property</returns>
public T1 Get<T1, T2>(PropertyKey<T1, T2> propertyKey)
public T1 Get<T1, T2>(PropertyBagKey<T1, T2> propertyKey)
{
var value = Get(propertyKey.Name);
return (T1) Convert.ChangeType(value, typeof (T1));
Expand All @@ -142,13 +142,13 @@ public void Set(string name, object value)
}

/// <summary>
/// Sets the value of the property by using a <see cref="PropertyKey{T1,T2}"/>
/// Sets the value of the property by using a <see cref="PropertyBagKey{T1,T2}"/>
/// </summary>
/// <typeparam name="T1">The public type of this property.</typeparam>
/// <typeparam name="T2">The marshaling type of this property.</typeparam>
/// <param name="propertyKey">The property key.</param>
/// <param name="value">The value.</param>
public void Set<T1,T2>(PropertyKey<T1,T2> propertyKey, T1 value)
public void Set<T1,T2>(PropertyBagKey<T1,T2> propertyKey, T1 value)
{
Set(propertyKey.Name, value);
}
Expand Down
Expand Up @@ -25,13 +25,13 @@ namespace SharpDX.Win32
/// </summary>
/// <typeparam name="T1">The public type of this property.</typeparam>
/// <typeparam name="T2">The marshaling type of this property.</typeparam>
public class PropertyKey<T1,T2>
public class PropertyBagKey<T1,T2>
{
/// <summary>
/// Initializes a new instance of the <see cref="PropertyKey&lt;T1, T2&gt;"/> class.
/// Initializes a new instance of the <see cref="PropertyBagKey{T1,T2}"/> class.
/// </summary>
/// <param name="name">The name.</param>
public PropertyKey(string name)
public PropertyBagKey(string name)
{
Name = name;
}
Expand Down

0 comments on commit 48eba7b

Please sign in to comment.