1. <tfoot id='cHuti'></tfoot>

        <bdo id='cHuti'></bdo><ul id='cHuti'></ul>
    2. <small id='cHuti'></small><noframes id='cHuti'>

      <legend id='cHuti'><style id='cHuti'><dir id='cHuti'><q id='cHuti'></q></dir></style></legend>

      1. <i id='cHuti'><tr id='cHuti'><dt id='cHuti'><q id='cHuti'><span id='cHuti'><b id='cHuti'><form id='cHuti'><ins id='cHuti'></ins><ul id='cHuti'></ul><sub id='cHuti'></sub></form><legend id='cHuti'></legend><bdo id='cHuti'><pre id='cHuti'><center id='cHuti'></center></pre></bdo></b><th id='cHuti'></th></span></q></dt></tr></i><div id='cHuti'><tfoot id='cHuti'></tfoot><dl id='cHuti'><fieldset id='cHuti'></fieldset></dl></div>

        DefaultValue 属性不适用于我的自动属性

        DefaultValue attribute is not working with my Auto Property(DefaultValue 属性不适用于我的自动属性)
            <bdo id='IuwE6'></bdo><ul id='IuwE6'></ul>
            <tfoot id='IuwE6'></tfoot>

                <tbody id='IuwE6'></tbody>
              <i id='IuwE6'><tr id='IuwE6'><dt id='IuwE6'><q id='IuwE6'><span id='IuwE6'><b id='IuwE6'><form id='IuwE6'><ins id='IuwE6'></ins><ul id='IuwE6'></ul><sub id='IuwE6'></sub></form><legend id='IuwE6'></legend><bdo id='IuwE6'><pre id='IuwE6'><center id='IuwE6'></center></pre></bdo></b><th id='IuwE6'></th></span></q></dt></tr></i><div id='IuwE6'><tfoot id='IuwE6'></tfoot><dl id='IuwE6'><fieldset id='IuwE6'></fieldset></dl></div>
              <legend id='IuwE6'><style id='IuwE6'><dir id='IuwE6'><q id='IuwE6'></q></dir></style></legend>

                  <small id='IuwE6'></small><noframes id='IuwE6'>

                  本文介绍了DefaultValue 属性不适用于我的自动属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有以下自动属性

                  [DefaultValue(true)]
                  public bool RetrieveAllInfo { get; set; }
                  

                  当我尝试在代码中使用它时,我发现默认 false 是 false 我假设这是 bool 变量的默认值,有人有提示有什么问题!?

                  when I try to use it inside the code i find the default false for is false I assume this is the default value to a bool variable, does anyone have a clue what is wrong!?

                  推荐答案

                  DefaultValue 属性仅用于告诉 Visual Studio 设计人员(例如在设计表单时)属性的默认值是什么.它不会在代码中设置属性的实际默认值.

                  The DefaultValue attribute is only used to tell the Visual Studio Designers (for example when designing a form) what the default value of a property is. It doesn't set the actual default value of the attribute in code.

                  更多信息在这里:http://support.microsoft.com/kb/311339

                  这篇关于DefaultValue 属性不适用于我的自动属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  How can I force the PropertyGrid to show a custom dialog for a specific property?(如何强制 PropertyGrid 显示特定属性的自定义对话框?)
                  Associate attribute with code generated property in .net(将属性与 .net 中的代码生成属性相关联)

                  <small id='YmzFE'></small><noframes id='YmzFE'>

                1. <tfoot id='YmzFE'></tfoot>

                    <i id='YmzFE'><tr id='YmzFE'><dt id='YmzFE'><q id='YmzFE'><span id='YmzFE'><b id='YmzFE'><form id='YmzFE'><ins id='YmzFE'></ins><ul id='YmzFE'></ul><sub id='YmzFE'></sub></form><legend id='YmzFE'></legend><bdo id='YmzFE'><pre id='YmzFE'><center id='YmzFE'></center></pre></bdo></b><th id='YmzFE'></th></span></q></dt></tr></i><div id='YmzFE'><tfoot id='YmzFE'></tfoot><dl id='YmzFE'><fieldset id='YmzFE'></fieldset></dl></div>

                    <legend id='YmzFE'><style id='YmzFE'><dir id='YmzFE'><q id='YmzFE'></q></dir></style></legend>
                      <tbody id='YmzFE'></tbody>
                        • <bdo id='YmzFE'></bdo><ul id='YmzFE'></ul>