本文整理汇总了C#中IData.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# IData.ContainsKey方法的具体用法?C# IData.ContainsKey怎么用?C# IData.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IData
的用法示例。
在下文中一共展示了IData.ContainsKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetFromIData
protected override void SetFromIData(ILogicalDevice logicalDevice, IData data)
{
base.SetFromIData(logicalDevice, data);
if (data.ContainsKey(DataElements.ColorAmber) ||
data.ContainsKey(DataElements.ColorRGB) ||
data.ContainsKey(DataElements.ColorUltraViolet) ||
data.ContainsKey(DataElements.ColorWhite))
{
object value;
componentMaster = (this.colorBrightness.Brightness * (1 - Executor.Current.Blackout.Value)).GetByteScale();
Color colorRGB;
if (data.TryGetValue(DataElements.ColorRGB, out value))
colorRGB = (Color)value;
else
colorRGB = this.colorBrightness.Color;
componentRed = colorRGB.R;
componentGreen = colorRGB.G;
componentBlue = colorRGB.B;
//TODO: WhiteOut
if (data.TryGetValue(DataElements.ColorAmber, out value))
componentAmber = ((double)value).GetByteScale();
if (data.TryGetValue(DataElements.ColorWhite, out value))
componentWhite = ((double)value).GetByteScale();
if (data.TryGetValue(DataElements.ColorUltraViolet, out value))
componentUV = ((double)value).GetByteScale();
}
else
{
var rgbaw = RgbConverter.GetRGBAW(this.colorBrightness.Color);
componentMaster = this.colorBrightness.Brightness.GetByteScale();
componentRed = rgbaw.R;
componentGreen = rgbaw.G;
componentBlue = rgbaw.B;
componentAmber = rgbaw.A;
componentWhite = rgbaw.W;
}
}