daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. factory create method in C#?
  2. class TwsCom {
  3.  
  4.   private ApiComObject apiComObject;
  5.  
  6.   public TwsCom() {
  7.     apiComObject = new ApiComObject(); // create an instance, if required
  8.   }
  9.   // you might want to keep this variable type private to avoid breaking
  10.   // the rules
  11.   private ActiveXType NewActiveXType() {
  12.     return apiComObject.Create();
  13.   }
  14.  
  15.   public object SomeMethod() {
  16.     ActiveXType activeX = NewActiveXType();
  17.     return activeX.SomeMethod();
  18.   }
  19.  
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top