本文整理汇总了C#中CheckBox.Bind方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.Bind方法的具体用法?C# CheckBox.Bind怎么用?C# CheckBox.Bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckBox
的用法示例。
在下文中一共展示了CheckBox.Bind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildDetails
private void BuildDetails()
{
_details.UnBind();
_details.Controls.Clear();
var material = this.GameObject as PluginBase.GameObjects.Material;
//var shader = Plugins.Container.ResolveNamed<TokED.ShaderDefinition>(material.Shader);
_depthTest = _details.AddLabeledCheckBox(100, "Depth Test:");
_depthTest.Bind(this.GameObject, "DepthTest");
_alphaBlend = _details.AddLabeledCheckBox(100, "Alpha Blend:");
_alphaBlend.Bind(this.GameObject, "AlphaBlend");
_smoothLines = _details.AddLabeledCheckBox(100, "Smooth Lines:");
_smoothLines.Bind(this.GameObject, "SmoothLines");
_minFilter = _details.AddEnumList(100, "Min Filter:", typeof(TextureMinFilter));
_minFilter.Bind(this.GameObject, "MinFilter");
_magFilter = _details.AddEnumList(100, "Mag Filter:", typeof(TextureMagFilter));
_magFilter.Bind(this.GameObject, "MagFilter");
//Shader Parameters
foreach (var p in material.Parameters)
{
switch (p.Type)
{
case ShaderParamType.Int:
_details.AddLabeledTextBox(100, p.LongName + ":", 1.0f).Bind(p, "IntValue").Bind(this.GameObject, "ApplyParameters");
break;
case ShaderParamType.Float:
_details.AddLabeledTextBox(100, p.LongName + ":", 0.02f).Bind(p, "FloatValue").Bind(this.GameObject, "ApplyParameters");
break;
case ShaderParamType.Vec2:
_details.AddLabeledTextBox(100, p.LongName + " X:", 0.02f).Bind(p, "X").Bind(this.GameObject, "ApplyParameters");
_details.AddLabeledTextBox(100, p.LongName + " Y:", 0.02f).Bind(p, "Y").Bind(this.GameObject, "ApplyParameters");
break;
case ShaderParamType.Vec3:
_details.AddLabeledTextBox(100, p.LongName + " X:", 0.02f).Bind(p, "X").Bind(this.GameObject, "ApplyParameters");
_details.AddLabeledTextBox(100, p.LongName + " Y:", 0.02f).Bind(p, "Y").Bind(this.GameObject, "ApplyParameters");
_details.AddLabeledTextBox(100, p.LongName + " Z:", 0.02f).Bind(p, "Z").Bind(this.GameObject, "ApplyParameters");
break;
case ShaderParamType.Vec4:
_details.AddLabeledTextBox(100, p.LongName + " X:", 0.02f).Bind(p, "X").Bind(this.GameObject, "ApplyParameters");
_details.AddLabeledTextBox(100, p.LongName + " Y:", 0.02f).Bind(p, "Y").Bind(this.GameObject, "ApplyParameters");
_details.AddLabeledTextBox(100, p.LongName + " Z:", 0.02f).Bind(p, "Z").Bind(this.GameObject, "ApplyParameters");
_details.AddLabeledTextBox(100, p.LongName + " W:", 0.02f).Bind(p, "W").Bind(this.GameObject, "ApplyParameters");
break;
case ShaderParamType.Color:
_details.AddLabeledColorButton(100, p.LongName + ":").Bind(p, "Color").Bind(this.GameObject, "ApplyParameters");
break;
case ShaderParamType.Texture:
_details.AddLabeledFilename(100, p.LongName + ":", ".png", "Texture (.png)|*.png", "Load Texture from file:")
.Bind(p, "Filename")
.Bind(this.GameObject, "NotifyChange");
break;
}
}
_details.Size = new Point(0, 20 * _details.Controls.Count);
}