The DLL where the path rule resides
System.Reflection.Assembly ass=system.relection.assembly.load ("Pathcheck");
Create this instance note: You must use the namespace + class name
Object Obj=ass. CreateInstance ("Pathcheck.sualapplylowdistrictprincipalcommit");
Instance:
In order to extend and maintain later, in general, you need to create a parent class, for the time being named Pathcheckbase, as follows
1 Public classpathcheckbase{2 Public Virtual BOOLRoutingrule (stringStr out stringoutmsg) {3Outmsg ="";4 return true;5 }6 Public Virtual BOOLCheckrule (stringStr out stringoutmsg)7 {8Outmsg ="";9 return true;Ten } One}View Code
Create a subclass such as the following:
1 Public classStoreecogopublicprincipalcommit:pathcheckbase2 {3 //overriding methods of the parent class4 Public Override BOOLRoutingrule (stringStr out stringoutmsg)5 { 6Outmsg ="";7 return true;8 }9 Ten Public Override BOOLCheckrule (stringStr out stringoutmsg) One { A return true; - } -}View Code
Methods to override a parent class in a dynamic call subclass
1 //the DLL where the path rule resides2System.Reflection.Assembly-System.Reflection.Assembly.Load ("Pathcheck");3Object obj =. CreateInstance ("Pathcheck.storeecogopublicprincipalcommit");//must use namespace + class name4 if(! ((pathcheck.pathcheckbase) obj). Routingrule (GPC, outoutmsg))5 {6 return-1;7 }8 if(! ((pathcheck.pathcheckbase) obj). Checkrule (GPC, outoutmsg))9 {Ten return-1; One}View Code
. NET Dynamic Loading assemblies