Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- factory create method in C#?
- class TwsCom {
- private ApiComObject apiComObject;
- public TwsCom() {
- apiComObject = new ApiComObject(); // create an instance, if required
- }
- // you might want to keep this variable type private to avoid breaking
- // the rules
- private ActiveXType NewActiveXType() {
- return apiComObject.Create();
- }
- public object SomeMethod() {
- ActiveXType activeX = NewActiveXType();
- return activeX.SomeMethod();
- }
- }
Add Comment
Please, Sign In to add comment