I have seen the following method syntax and I am trying to understand how this works/or doesn't:
public class MyClass
{
public MyClass();
public MyClass(string param);
}
There is no implementation of the methods (constructors) and class is not declared virtual either...
Is this something new in C# 3.0 ???
Any ideas???
Thank you
Perhaps you saw some C++ code that looks like this, which in its simplest form, is very similar in appearance. In C++, this is called forward declaration. C# does not allow forward declarations.
Last edited by DdoubleD; Oct 24th, 2009 at 9:33 am.
public Route(string url, IRouteHandler routeHandler);
...
public IRouteHandler RouteHandler { get; set; }
publicstring Url { get; set; }
}
}
It would appear as though the terse Property get/set syntax is pairing with an additional terse constructor syntax that sets those public properties for you automatically, simply by having constructor parameters with the same name and type (but all lowercase instead of mixed case). Very cool... but I can't find any documentation so far to support this.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.