Free mag vol1 | Page 350

CHAPTER 8  WORKING WITH INTERFACES } // IPointy implementation. public byte Points { get { return 6; } } To sum up the story so far, the Visual Studio class diagram shown in Figure 8-2 illustrates IPointycompatible classes using the popular “lollipop” notation. Notice again that Circle and ThreeDCircle do not implement IPointy, as this behavior makes no sense for these particular classes. Figure 8-2. The shapes hierarchy, now with interfaces  Note To display or hide interface names on the class designer, right-click on the interface icon and select the Collapse or Expand option. Invoking Interface Members at the Object Level Now that you have some classes that support the IPointy interface, the next question is how you interact with the new functionality. The most straightforward way to interact with functionality supplied by a given interface is to invoke the members directly from the object level (provided the interface members are not implemented explicitly; more details later in the section “Explicit Interface Implementation”). For example, consider the following Main() method: static void Main(string[] args) { Console.WriteLine("***** Fun with Interfaces *****\n"); 288