当前位置: 首页>>代码示例>>C#>>正文


C# CheckBox.Bind方法代码示例

本文整理汇总了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);
        }
开发者ID:Tokter,项目名称:TokED,代码行数:68,代码来源:MaterialInsOld.cs


注:本文中的CheckBox.Bind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。