Tuesday, September 29, 2009

C++/CLI Property Data Types




Why isn't the code below working

[ConfigurationPropertyAttribute("FromDate", IsRequired=false)]
property DateTime^ FromDate
{
DateTime^ get() { return (DateTime^)this["FromDate"]; }
void set(DateTime^ value) { this["FromDate"] = value; }
}

[ConfigurationPropertyAttribute("ToDate", IsRequired=false)]
property DateTime^ ToDate
{
DateTime^ get() { return (DateTime^)this["ToDate"]; }
void set(DateTime^ value) { this["ToDate"] = value; }
}


while the one below does:


[ConfigurationPropertyAttribute("FromDate", IsRequired=false)]
property DateTime FromDate
{
DateTime get() { return (DateTime^)this["FromDate"]; }
void set(DateTime^ value) { this["FromDate"] = value; }
}

[ConfigurationPropertyAttribute("ToDate", IsRequired=false)]
property DateTime ToDate
{
DateTime get() { return (DateTime^)this["ToDate"]; }
void set(DateTime^ value) { this["ToDate"] = value; }
}