//Called when the client sends a "Initialize-Connection" message to the server. Set's up all RPC on the host/server side static void GetConnection(PacketHeader header, Connection connection, string message) { StopServerListener(); //Add a event handler to handle a shutdown of the connection connection.AppendShutdownHandler(new NetworkComms.ConnectionEstablishShutdownDelegate((c) => MDI_Container.staticMdi_Container.BeginInvoke(MDI_Container.staticMdi_Container.DLostConnection))); //Set the RPC server to use the newly established connection with the client RemoteProcedureCalls.Server.serverConnection = connection; //Register a instance of the server interface and make it available to the client via RPC RemoteProcedureCalls.Server.RegisterInstanceForPublicRemoteCall <ServerInterfaceClass, IServerInterface>(new ServerInterfaceClass(), "Server"); //Get the clients RPC interface StaticClientInterface = RemoteProcedureCalls.Client.CreateProxyToPublicNamedInstance <IClientInterface>(connection, "Client", out RPCInstanceID, new SendReceiveOptions <ProtobufSerializer>()); //Send a command to the client to tell it to connect to the servers RPC connection.SendObject <string>("Initialize-Connection", ""); }
public Preferences(IClientInterface client) { InitializeComponent(); _clientManager = client; EnableAvaliableFeatures(); lblAbout.Text = _clientManager.Status.ClientVersion; lblStatus.Text = GetStatusMessage(_clientManager.Status.IsEverythingOk, _clientManager.Status.LastSuccessfulTransmission); _clientManager.Status.StatusChanged += new Action(Status_StatusChanged); if (_clientManager.Snooze != null) { EnableSnoozeFeature(); } _clientManager.Alert.AlertMessenger += new Action <string>(Alert_AlertMessenger); _clientManager.Alert.AlertSystemIsIdle += new Action <DateTime>(Alert_AlertSystemIsIdle); }
public OfflineTimeForm(IClientInterface client, DateTime offlineSince) { InitializeComponent(); _clientManager = client; _offlineSince = offlineSince; _isFirstNotification = true; _clientManager.Alert.AlertSystemIsBusy += new Action <DateTime>(Alert_AlertSystemIsBusy); _connector = new OfflineDialogInterface(); _buttonsText = _clientManager.Settings.OfflineTaskCategory; //_connector.GetButtonText(); Debug.Assert(_buttonsText.Length == 6, "GetButtonText returned count != 6"); // any better way to do this this.button1.Text = _buttonsText[0]; this.button2.Text = _buttonsText[1]; this.button3.Text = _buttonsText[2]; this.button4.Text = _buttonsText[3]; this.button5.Text = _buttonsText[4]; this.button6.Text = _buttonsText[5]; lblWhatHaveSince.Text = string.Format("What have you been doing since {0}?", offlineSince.ToString("HH:MM")); _timer = new Timer() { Interval = 1000, Enabled = true }; _timer.Tick += new EventHandler(_timer_Tick); _timer.Start(); _DebugDisableAlwaysOnTop(); }
public ClientController(IClientInterface client, Validators validate, HttpResponses response) { _client = client; _validate = validate; _response = response; }
public Endpoint(IClientInterface client, string url) { this._client = client; this._url = url; }