class - How to compare two classes in vb.net? -
let's suppose have class
this:
class myclass(of template) 'some things here end class
so far, good. however, things depending on template, like
class myclass(of template) 'some things here public sub mymethod 'if template myotherclass ' things 'else ' other things 'end if end sub end class
of course, give object , check whether typeof (obj) myotherclass
, seems less intuitive me. there way compare 2 classes in vb.net?
you compare type
class myclass(of template) 'some things here public sub mymethod if gettype(template) gettype(myotherclass) things else other things end if end sub end class
but seems bad thing do. point of oo have logic in it's respective class instead of doing this.
Comments
Post a Comment