本文整理汇总了C#中Color.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Color.GetType方法的具体用法?C# Color.GetType怎么用?C# Color.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Color
的用法示例。
在下文中一共展示了Color.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshColorControls
private void RefreshColorControls(Color component)
{
List<Control> controls;
componentControls.TryGetValue(component.GetType(), out controls);
((Slider)controls[1]).Value = component.R;
((Slider)controls[3]).Value = component.G;
((Slider)controls[5]).Value = component.B;
((Slider)controls[7]).Value = component.A;
}
示例2: Copy
public void Copy(Color obj)
{
if (obj == null)
return;
// copy all of the properties
foreach (PropertyInfo pi in obj.GetType().GetProperties())
{
// get the value of the property
var val = pi.GetValue(obj, null);
pi.SetValue(this, val, null);
}
}
示例3: ColorToName
internal string ColorToName(Color color)
{
string str = color.ToArgb().ToString("x");
if (color.IsSystemColor)
{
try
{
object obj2 = color.GetType().GetField("m_clr", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(color);
int index = (int) obj2.GetType().GetField("m_nVal", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(obj2);
str = this.SystemColorNames[index];
}
catch
{
}
}
return str;
}
示例4: Copy
public void Copy(Color value)
{
// copy all of the properties
foreach (PropertyInfo pi in value.GetType().GetProperties())
{
// get the value of the property
var val = pi.GetValue(value, null);
pi.SetValue(this, val, null);
}
}
示例5: Write139_Color
private void Write139_Color(string n, string ns, Color o, bool needType)
{
if (!needType && (o.GetType() != typeof(Color)))
{
throw base.CreateUnknownTypeException(o);
}
base.WriteStartElement(n, ns, o, false, null);
if (needType)
{
base.WriteXsiType("Color", "");
}
base.WriteEndElement(o);
}