Since the interface is already on the diagram I would like to show inheritance reference explicitly. But I can't find how...
There is a bug in VS 2005 up to 2012 that won't allow it to work. I have a work arround that might trick it into drawing the inheritance for interfaces. Say your interface is called IMyInterface. You have to replace it with an abstract class implementing that interface and use it instead of your interface. The code would make use of the conditional compilation and will look like this:
//to generate class diagram, add 'CLSDIAGRAM' to the conditional symbols on the Build tab, // or add '#define CLSDIAGRAM' at the top of this file #if CLSDIAGRAM #warning CLSDIAGRAM is defined and this build should be used only in the context of class diagram generation //rename your interface by adding _ public interface IMyInterface_ { int MyProperty { get; } void MyMethod(); } //this class will act as an interface in the class diagram ;) public abstract class IMyInterface : IMyInterface_ // tricks other code into using the class instead { //fake implementation public int MyProperty { get { throw new NotImplementedException(); } } public void MyMethod() { throw new NotImplementedException(); } } #else // this is the original interface public interface IMyInterface { int MyProperty { get; } void MyMethod(); } #endif
That's likely to show it as you wish. In your case IMyInterface will become IMedicine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With