mirror of https://github.com/dahall/Vanara.git
Updated property layout.
parent
854b5c17c3
commit
8cce2a634e
|
@ -276,8 +276,8 @@ namespace Vanara.PInvoke
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>The LOGFONT structure defines the attributes of a font.</summary>
|
/// <summary>The LOGFONT structure defines the attributes of a font.</summary>
|
||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
|
||||||
[PInvokeData("Wingdi.h", MSDNShortId = "dd145037")]
|
[PInvokeData("Wingdi.h", MSDNShortId = "dd145037")]
|
||||||
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||||
public struct LOGFONT
|
public struct LOGFONT
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -387,7 +387,8 @@ namespace Vanara.PInvoke
|
||||||
/// <value>The font family.</value>
|
/// <value>The font family.</value>
|
||||||
public FontFamily FontFamily
|
public FontFamily FontFamily
|
||||||
{
|
{
|
||||||
get => (FontFamily)(lfPitchAndFamily & 0xF0); set => lfPitchAndFamily = (byte)((lfPitchAndFamily & 0x0F) | (byte)value);
|
get => (FontFamily)(lfPitchAndFamily & 0xF0);
|
||||||
|
set => lfPitchAndFamily = (byte)((lfPitchAndFamily & 0x0F) | (byte)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -398,12 +399,8 @@ namespace Vanara.PInvoke
|
||||||
/// <value>The face name of the font.</value>
|
/// <value>The face name of the font.</value>
|
||||||
public string lfFaceName
|
public string lfFaceName
|
||||||
{
|
{
|
||||||
get => _lfFaceName; set
|
get => _lfFaceName;
|
||||||
{
|
set => _lfFaceName = value?.Length <= 31 ? value : throw new ArgumentException(@"The face name may not have more than 31 characters.", nameof(lfFaceName));
|
||||||
if (value?.Length > 31)
|
|
||||||
throw new ArgumentException(@"The face name may not have more than 31 characters.", nameof(lfFaceName));
|
|
||||||
_lfFaceName = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -412,19 +409,16 @@ namespace Vanara.PInvoke
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public short lfWeight
|
public short lfWeight
|
||||||
{
|
{
|
||||||
get => (short)_lfWeight; set
|
get => (short)_lfWeight;
|
||||||
{
|
set => _lfWeight = value >= 0 && value <= 1000 ? value : throw new ArgumentOutOfRangeException(nameof(lfWeight), @"Font weight must be a value in the range 0 through 1000.");
|
||||||
if (value < 0 || value > 1000)
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(lfWeight), @"Font weight must be a value in the range 0 through 1000.");
|
|
||||||
_lfWeight = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Gets or sets the font pitch.</summary>
|
/// <summary>Gets or sets the font pitch.</summary>
|
||||||
/// <value>The pitch.</value>
|
/// <value>The pitch.</value>
|
||||||
public FontPitch Pitch
|
public FontPitch Pitch
|
||||||
{
|
{
|
||||||
get => (FontPitch)(lfPitchAndFamily & 0x0F); set => lfPitchAndFamily = (byte)((lfPitchAndFamily & 0xF0) | (byte)value);
|
get => (FontPitch)(lfPitchAndFamily & 0x0F);
|
||||||
|
set => lfPitchAndFamily = (byte)((lfPitchAndFamily & 0xF0) | (byte)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Returns a <see cref="System.String"/> that represents this instance.</summary>
|
/// <summary>Returns a <see cref="System.String"/> that represents this instance.</summary>
|
||||||
|
|
Loading…
Reference in New Issue