Пример #1
0
        static void Use()
        {
            EditBox editbox = new EditBox();

            editbox.Paint();    // error: no such method
            IControl control = editbox;

            control.Paint();    // calls EditBox抯 Paint implementation
        }
Пример #2
0
 static void UsageTwo()
 {
     object obj = new EditBox();
     IControl control = (IControl)obj;
     IDataBound dataBound = (IDataBound)obj;
 }
Пример #3
0
 static void UsageOne()
 {
     EditBox editBox = new EditBox();
     IControl control = editBox;
     IDataBound dataBound = editBox;
 }
Пример #4
0
 static void UsageTwo()
 {
     object     obj       = new EditBox();
     IControl   control   = (IControl)obj;
     IDataBound dataBound = (IDataBound)obj;
 }
Пример #5
0
 static void UsageOne()
 {
     EditBox    editBox   = new EditBox();
     IControl   control   = editBox;
     IDataBound dataBound = editBox;
 }