本文整理汇总了C#中PropVariant.SetDecimal方法的典型用法代码示例。如果您正苦于以下问题:C# PropVariant.SetDecimal方法的具体用法?C# PropVariant.SetDecimal怎么用?C# PropVariant.SetDecimal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropVariant
的用法示例。
在下文中一共展示了PropVariant.SetDecimal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPropVariant
public override void GetPropVariant(PropertyKey key, PropVariantRef currentValue, ref PropVariant value)
{
if (key == PropertyKeys.DecimalValue)
{
value.SetDecimal(Value);
}
else if (key == PropertyKeys.MinValue)
{
value.SetDecimal(MinValue);
}
else if (key == PropertyKeys.MaxValue)
{
value.SetDecimal(MaxValue);
}
else if (key == PropertyKeys.Increment)
{
value.SetDecimal(Increment);
}
else if (key == PropertyKeys.DecimalPlaces)
{
value.SetUInt(DecimalPlaces);
}
else if (key == PropertyKeys.FormatString)
{
value.SetString(FormatString);
}
else
base.GetPropVariant(key, currentValue, ref value);
}
示例2: UpdateProperty
/// <summary>
/// Handles IUICommandHandler.UpdateProperty function for the supported properties
/// </summary>
/// <param name="key">The Property Key to update</param>
/// <param name="currentValue">A pointer to the current value for key. This parameter can be NULL</param>
/// <param name="newValue">When this method returns, contains a pointer to the new value for key</param>
/// <returns>Returns S_OK if successful, or an error value otherwise</returns>
public override HRESULT UpdateProperty(ref PropertyKey key, PropVariantRef currentValue, ref PropVariant newValue)
{
if (key == RibbonProperties.DecimalValue)
{
}
else if (key == RibbonProperties.Increment)
{
if (_increment.HasValue)
{
newValue.SetDecimal(_increment.Value);
}
}
else if (key == RibbonProperties.MaxValue)
{
if (_maxValue.HasValue)
{
newValue.SetDecimal(_maxValue.Value);
}
}
else if (key == RibbonProperties.MinValue)
{
if (_minValue.HasValue)
{
newValue.SetDecimal(_minValue.Value);
}
}
else if (key == RibbonProperties.DecimalPlaces)
{
if (_decimalPlaces.HasValue)
{
newValue.SetUInt(_decimalPlaces.Value);
}
}
else if (key == RibbonProperties.FormatString)
{
if (_formatString != null)
{
newValue.SetString(_formatString);
}
}
return HRESULT.S_OK;
}