![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Q: How are ConfigurationProperty default values assigned toclass/struct attributes? Hello group, How are ConfigurationProperty default values (i.e. DefaultValue) assigned to struct and class attributes (e.g. TimeSpan)? The Visual Studio 2005 help for ConfigurationPropertyAttribute.DefaultValue provides the following sample (I pasted the C# version, but there is also a Visual Basic version): ///////////////////////////////////////////////// [ConfigurationProperty("maxIdleTime", DefaultValue = "0:10:0", IsRequired = false)] [TimeSpanValidator(MinValueString = "0:0:30", MaxValueString = "5:00:0", ExcludeRange = false)] public TimeSpan MaxIdleTime { get { return (TimeSpan)this["maxIdleTime"]; } set { this["maxIdleTime"] = value; } } ///////////////////////////////////////////////// What I am wondering is how does this DefaultValue parameter from the sample code work: Quote: Quote: >> DefaultValue = "0:10:0", string parameter, and TimeSpan does not implement IConvertible. For example, the following does not complile: Quote: Quote: >> TimeSpan ts = "0:10:0"; Quote: Quote: >> public static TimeSpan Parse(string s); So again how does this code from the sample work?: Quote: Quote: >> DefaultValue = "0:10:0", TIA, Keller Beyer beyeriii@xxxxxx |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| No Assigned Default Gateway, DNS Server or WINS Server... | Network & Sharing | |||
| How to map openssl obtained private key parameters to RSAParameters struct members? | .NET General | |||
| How to show non-default attributes | PowerShell | |||
| Re: How to show non-default attributes | PowerShell | |||
| Struct\Class Creation | PowerShell | |||