Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem with using VNC hooking Pin
Dave Kreskowiak19-May-04 3:24
mveDave Kreskowiak19-May-04 3:24 
GeneralSockets question Pin
Vladimir Georgiev18-May-04 20:47
Vladimir Georgiev18-May-04 20:47 
GeneralRe: Sockets question Pin
Roman Rodov18-May-04 21:07
Roman Rodov18-May-04 21:07 
GeneralRe: Sockets question Pin
Vladimir Georgiev19-May-04 2:44
Vladimir Georgiev19-May-04 2:44 
GeneralRe: Sockets question Pin
Heath Stewart19-May-04 4:02
protectorHeath Stewart19-May-04 4:02 
Generalconnecting user controls in c sharp Pin
samithas18-May-04 19:33
samithas18-May-04 19:33 
GeneralRe: connecting user controls in c sharp Pin
etfintnick19-May-04 2:03
etfintnick19-May-04 2:03 
GeneralRe: connecting user controls in c sharp Pin
Heath Stewart19-May-04 3:55
protectorHeath Stewart19-May-04 3:55 
A common approach is to define a base class from which all shapes derive. You would define a property on this class that is either a collection or array (which is actually a static collection and list) that stores points. If you want, you could define this property as virtual and provide default connection points. If you declare it as abstract, then every derivative must override it. For any classes where you want to return a custom list of connection points, override the property (assuming it's optionally using a virtual property) and return coordinates of connection points.

Then, these connection point classes that you store maintain a list of other controls' connection points (which should have a member that returns the control they're a connection point for). When painting the container/surface, you draw a line between each connection point that is related to another. This is the reason you define a base class - so you can refer to every shape through it's abstract base class. This is polymorphism.

If you search CodeProject, you should find a couple examples, IIRC.

 

Microsoft MVP, Visual C#
My Articles
Generalregd C# classes Pin
karteek18-May-04 19:21
karteek18-May-04 19:21 
GeneralRe: regd C# classes Pin
Charlie Williams18-May-04 19:52
Charlie Williams18-May-04 19:52 
GeneralRe: regd C# classes Pin
sreejith ss nair18-May-04 20:21
sreejith ss nair18-May-04 20:21 
GeneralRe: regd C# classes Pin
etfintnick19-May-04 2:06
etfintnick19-May-04 2:06 
GeneralC# Class Pin
sreejith ss nair18-May-04 17:20
sreejith ss nair18-May-04 17:20 
GeneralRe: C# Class Pin
TigerNinja_18-May-04 18:17
TigerNinja_18-May-04 18:17 
GeneralRe: C# Class Pin
Stefan Troschuetz18-May-04 20:53
Stefan Troschuetz18-May-04 20:53 
GeneralRe: C# Class Pin
sreejith ss nair18-May-04 21:22
sreejith ss nair18-May-04 21:22 
GeneralRe: C# Class Pin
Colin Angus Mackay18-May-04 22:53
Colin Angus Mackay18-May-04 22:53 
GeneralClass Pin
sreejith ss nair18-May-04 17:17
sreejith ss nair18-May-04 17:17 
GeneralMobile Application Pin
Masood Lodhi18-May-04 13:54
Masood Lodhi18-May-04 13:54 
GeneralRe: Mobile Application Pin
sreejith ss nair18-May-04 17:25
sreejith ss nair18-May-04 17:25 
GeneralRe: Mobile Application Pin
Masood Lodhi23-May-04 2:19
Masood Lodhi23-May-04 2:19 
QuestionComponent Exception vs Error Event?? Pin
MilesAhead18-May-04 13:38
MilesAhead18-May-04 13:38 
AnswerRe: Component Exception vs Error Event?? Pin
TigerNinja_18-May-04 15:40
TigerNinja_18-May-04 15:40 
AnswerRe: Component Exception vs Error Event?? Pin
Grimolfr19-May-04 7:56
Grimolfr19-May-04 7:56 
GeneralException Pin
cristina_tudor18-May-04 12:57
cristina_tudor18-May-04 12:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.