I'm wondering if there's a compile time cast gaurantee if any?
Given the following:
//----- begin sample code
public interface IRegion
{
string Text { get; }
RectangleF Area { get; }
}
public class Region : IRegion
{
public Region()
{
}
public Region(string text)
{
this._text = text;
}
public string Text { get { return this._text; } } // takes care of
IRegion.Text
internal protected void Set_Text(string value) { this._text = value; }
public RectangleF Area { get { return RectangleF.Empt y; } } //takes care
of IRegion.Area
}
//---- end of code
Since Region specifically implements IRegion, we are guaranteed that a cast
from Region to IRegion will work, so I'm hoping for a more strict compile
time casting check that would obviously fail if the Region class doesnt
implement IRegion anymore, instead of finding out at runtime that the cast
failed.
Are there any plans for this?
--
Eric Newton
C#/ASP Application Developer
http://ensoft-software.com/
er**@cc.ensoft-software.com [remove the first "CC."]