Created
April 16, 2019 21:27
-
-
Save morales-franco/46581836ad6492e11deffb1252d73648 to your computer and use it in GitHub Desktop.
Reflection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public ICommunicator GetCommunicator(string typeName) | |
| { | |
| Type communicatorType = Type.GetType(typeName); | |
| if (communicatorType == null) | |
| throw new NullReferenceException(); | |
| ICommunicator communicator = Activator.CreateInstance(communicatorType, new object[] { new ConnectionParameters() | |
| { | |
| IP = "My IP", | |
| Port = 993 | |
| } }) as ICommunicator; | |
| return communicator; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var communicator = communicatorService.GetCommunicator("Integra.Communicator.Zk.CommunicatorApi,Integra.Communicator.Zk"); | |
| foreach (var user in communicator.GetUsers()) | |
| Console.WriteLine($"Identifier: { user.Identifier }"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment