public XToolsApp(string[] args = null) { parsedArguments = ParseCommandLine(args); this.logWriter = new ConsoleLogWriter(); ClientConfig config = new ClientConfig(ClientRole.Primary); config.SetServerAddress(GetArgumentOrDefault("sessionserver", "localhost")); config.SetLogWriter(this.logWriter); this.Manager = SharingManager.Create(config); this.syncListener = new ConsoleSyncReporter(); this.viewerConnection = this.Manager.GetPairedConnection(); this.serverConnection = this.Manager.GetServerConnection(); this.SessionManager = this.Manager.GetSessionManager(); BeginPairing(); ViewerListener = new NetworkConnectionAdapter(); ViewerListener.ConnectedCallback += this.OnViewerConnected; ViewerListener.ConnectionFailedCallback += this.OnViewerConnectionFailed; ViewerListener.DisconnectedCallback += this.OnViewerDisconnected; viewerConnection.AddListener((byte)MessageID.StatusOnly, ViewerListener); ServerListener = new NetworkConnectionAdapter(); ServerListener.ConnectedCallback += this.OnSessionConnected; ServerListener.ConnectionFailedCallback += this.OnSessionConnectionFailed; ServerListener.DisconnectedCallback += this.OnSessionDisconnected; serverConnection.AddListener((byte)MessageID.StatusOnly, ServerListener); this.rootObject = this.Manager.GetRootSyncObject(); this.rootObject.AddListener(this.syncListener); // Listen for new sessions SessionManagerListener = new XToolsSessionManagerListener(); this.SessionManager.AddListener(SessionManagerListener); }
public XToolsApp(string[] args = null) { parsedArguments = ParseCommandLine(args); this.logWriter = new ConsoleLogWriter(); ClientConfig config = new ClientConfig(ClientRole.Primary); config.SetServerAddress(GetArgumentOrDefault("sessionserver", "localhost")); config.SetLogWriter(this.logWriter); this.Manager = SharingManager.Create(config); this.syncListener = new ConsoleSyncReporter(); this.viewerConnection = this.Manager.GetPairedConnection(); this.serverConnection = this.Manager.GetServerConnection(); this.SessionManager = this.Manager.GetSessionManager(); BeginPairing(); ViewerListener = new NetworkConnectionAdapter(); ViewerListener.ConnectedCallback += this.OnViewerConnected; ViewerListener.ConnectionFailedCallback += this.OnViewerConnectionFailed; ViewerListener.DisconnectedCallback += this.OnViewerDisconnected; viewerConnection.AddListener((byte)MessageID.StatusOnly, ViewerListener); ServerListener = new NetworkConnectionAdapter(); ServerListener.ConnectedCallback += this.OnSessionConnected; ServerListener.ConnectionFailedCallback += this.OnSessionConnectionFailed; ServerListener.DisconnectedCallback += this.OnSessionDisconnected; serverConnection.AddListener((byte)MessageID.StatusOnly, ServerListener); this.rootObject = this.Manager.GetRootSyncObject(); this.rootObject.AddListener(this.syncListener); // Listen for new sessions SessionManagerListener = new XToolsSessionManagerListener(); this.SessionManager.AddListener(SessionManagerListener); }