Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- while(true){
- Somefunc();
- }
- }
- static void Somefunc()
- {
- Console.WriteLine("Hello World");
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- while(true){
- if(App1.SomeFuncIsCalled)
- InjectCode();
- }
- }
- static void InjectCode()
- {
- App1.Console.WriteLine("Hello World Injected");
- }
- }
- Hello World
- Hello World Injected
- class Program
- {
- [ImportMany("AddinContractName", typeof(IRunMe))]
- public IEnumerable<IRunMe> ThingsToRun { get; set; }
- void SomeFunc()
- {
- foreach(IRunMe thing in ThingsToRun)
- {
- thing.Run();
- }
- /* do whatever else ... */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement