code_junkie

How to solve “Must be MarshalByRefObject” in a good but multiple-inheritance amputated language like C#?

Nov 12th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public interface IMyType
  2. {
  3. string SayHello();
  4. string BaseTypeMethodIWantToUse();
  5. }
  6.  
  7. public class MyType : MyBaseType, IMyType
  8. {
  9. public string SayHello()
  10. {
  11. return "Hello!";
  12. }
  13. }
  14.  
  15. public class MyRemoteableType : MarshalByRefObject, IMyType
  16. {
  17. private MyType _instance = new MyType();
  18.  
  19. public string SayHello()
  20. {
  21. return _instance.SayHello();
  22. }
  23.  
  24. public string BaseTypeMethodIWantToUse()
  25. {
  26. return _instance.BaseTypeMethodIWantToUse();
  27. }
  28. }
Add Comment
Please, Sign In to add comment