void OnConnected(object source, ConnectedEventArgs e) { ReadyToEnterGame (); if (e.IsConnected) { EmotionDeviceManager.Instance.Log("***** New Connection: " + e.ConnectedDevice + " *****"); Debug.Log ("This is the device: " + EmotionDeviceManager.Instance.ConnectedDevice); } }
private void OnConnected(ConnectedEventArgs e) { try { e.Session.Authentication = AuthenticationType.Connected; if (Handler != null) { Handler.Connected(this, e); } } catch (Exception e_) { Error(e_, e.Session, "Server session connected process error!"); } }
void OnConnected(object source, ConnectedEventArgs e) { //Update connection button state UpdateConnectionButton(e.IsConnected); if (e.IsConnected) { BluetoothLEHardwareInterface.Log("**** New Connection: " + e.ConnectedDevice + " ****"); } else { BluetoothLEHardwareInterface.Log("**** Disconnected ****"); } }
private void NetworkConnected_Changed(object sender, ConnectedEventArgs e) { Dispatcher.Invoke(new Action(async() => { if (sender == InputTcpAddresshandler || sender == InputUdpAddresshandler) { SetLabelConnected(InputNetworkStatusLabel, e.IsConnected, e.Message); } else { SetLabelConnected(OutputNetworkStatusLabel, e.IsConnected, e.Message); } ValidateConnections(); })); }
private void SerialConnected_Changed(object sender, ConnectedEventArgs e) { Dispatcher.Invoke(new Action(async() => { if (sender == InputSerialDeviceHandler) { SetLabelConnected(InputSerialStatusLabel, e.IsConnected, e.Message); } else { SetLabelConnected(OutputSerialStatusLabel, e.IsConnected, e.Message); } ValidateConnections(); })); }
private static void EventSink_Connected(ConnectedEventArgs e) { Account acc = e.Mobile.Account as Account; if (acc == null) { return; } if (acc.Young && acc.m_YoungTimer == null) { acc.m_YoungTimer = new YoungTimer(acc); acc.m_YoungTimer.Start(); } }
private void MController_Connected(IPenClient sender, ConnectedEventArgs args) { ToggleControls(this.Content, true); if (args.DeviceName == null) { textBox.Text = String.Format("Firmware Version : {0}", args.FirmwareVersion); } else { textBox.Text = String.Format("Mac : {0}\r\n\r\nName : {1}\r\n\r\nSubName : {2}\r\n\r\nFirmware Version : {3}\r\n\r\nProtocol Version : {4}", args.MacAddress, args.DeviceName, args.SubName, args.FirmwareVersion, args.ProtocolVersion); } _client.StopWatcher(); }
void OnConnected(object source, ConnectedEventArgs e) { //Update connection button state UpdateConnectionButton(e.IsConnected); if (e.IsConnected) { manager.Log("**** New Connection: " + e.ConnectedDevice + " ****"); } else { manager.Log("**** Disconnected ****"); } }
private void ConnectionOpened(object sender, ConnectedEventArgs e) { HPacket endPointPkt = Connection.Local.ReceivePacketAsync().Result; e.HotelServer = HotelServer = HotelEndPoint.Parse(endPointPkt.ReadUTF8().Split('\0')[0], endPointPkt.ReadInt32()); e.HotelServerSource.SetResult(HotelServer); _ui.SetStatusMessage(Constants.CONNECTED); Invoke((MethodInvoker) delegate { SearchBtn.Enabled = true; Resources.RenderButtonState(SearchBtn, SearchBtn.Enabled); }); }
/// <summary> /// Handles successfull connections /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Connection Event arguments</param> private void HandleConnected(Object sender, ConnectedEventArgs e) { if (!this._editing) { // When not editing need to take the newly created connection this.Connection = e.Connection; } else { // Otherwise take just the definition and update the last modified this.Connection.Definition = e.Connection.Definition; this.Connection.LastModified = DateTimeOffset.UtcNow; } this.DialogResult = DialogResult.OK; this.Close(); }
private void Connected(object sender, ConnectedEventArgs e) { foreach (IHaltable haltable in _haltables) { if (haltable.InvokeRequired) { _restore = haltable.Restore; haltable.Invoke(_restore, new object[] { e }); } else { haltable.Restore(e); } } GC.Collect(); }
public override void Connected(IServer server, ConnectedEventArgs e) { System.Threading.Interlocked.Increment(ref mTotalConnections); HttpToken token = new HttpToken(); token.Request = new HttpRequest(); token.Request.Init(e.Session, this); e.Session.Tag = token; e.Session.SocketProcessHandler = this; if (Options.IOQueueEnabled) { token.IOQueue = mRequestIOQueues.Next(); } HttpConnected?.Invoke(server, e); base.Connected(server, e); }
public void SuccessTest() { ConnectedEventArgs expectedArgs = new ConnectedEventArgs( "server", ChaskisEventProtocol.IRC, this.ircWriter.Object ); HandlerArgs handlerArgs = ConstructArgs(expectedArgs.ToXml()); this.uut.HandleEvent(handlerArgs); Assert.IsNotNull(this.responseReceived); Assert.AreEqual(expectedArgs.Server, this.responseReceived.Server); Assert.AreEqual(expectedArgs.Protocol, this.responseReceived.Protocol); Assert.AreSame(expectedArgs.Writer, this.responseReceived.Writer); }
private static void MServer_Connected(object sender, ConnectedEventArgs e) { e.ServerClient.OnStoped(OnClientStoped); // Set more first ping (Default 5 seconds) stop server fast. e.ServerClient.PingTimeSpan = TimeSpan.FromSeconds(1); // Cookies all auto sync to client e.ServerClient.Cookies["ID"] = Guid.NewGuid().ToString(); Console.WriteLine($"SERVER Connected, Set Cookies ID is: {e.ServerClient.Cookies["ID"]}"); // Config request handlers e.ServerClient.OnReceiveRequest <UserLoginRequest, UserLoginResponse>("User.Login", OnUserLoginRequest); // Just call client session ready, can do more action e.ServerClient.SendCommand("Connected"); }
private static void EventSink_Connected(ConnectedEventArgs e) { var acc = e.Mobile.Account as Account; if (acc == null) { return; } if (!acc.Young || acc._YoungTimer != null) { return; } acc._YoungTimer = new YoungTimer(acc); acc._YoungTimer.Start(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnMasterConnectedChanged(object sender, ConnectedEventArgs e) { if (InvokeRequired) { BeginInvoke((MethodInvoker)(() => OnMasterConnectedChanged(sender, e))); return; } if (e.Connected) { DoPowerOn(); } else { DoPowerOff(); } }
private static void Server_Connected(object sender, ConnectedEventArgs e) { e.ServerClient.Session["Id"] = $"{++SessionId}"; Console.WriteLine($"{e.ServerClient.Session["Id"]} is connected."); #region New NamedStream Feature in Release 1.0.0.2 var stream = e.ServerClient.GetNamedStream("TEST"); var streamWorkThreadRunning = true; var streamWorkThread = new Thread(() => { while (streamWorkThreadRunning) { if (stream.DataAvailable > 0) { Console.WriteLine($"{stream.Name} Revice Byte: {stream.ReadByte()}"); } } }); streamWorkThread.IsBackground = true; streamWorkThread.Start(); #endregion e.ServerClient .OnReceive <string>((str, client) => { Console.WriteLine($"Client {client.Session["Id"]} say: {str}"); client.SendObject(true); }) #region New SendBytes Feature in Release 1.0.0.3 .OnReceiveBytes((bytes, client) => { Console.WriteLine($"Client {client.Session["Id"]} send bytes: {BitConverter.ToString(bytes)}"); }) #endregion #region New Request Feature in Release 1.0.1 .OnReceiveRequest <string, DateTime>("Time", (request, c) => DateTime.Now) #endregion .OnStoped(client => { #region New NamedStream Feature in Release 1.0.0.2 streamWorkThreadRunning = false; #endregion Console.WriteLine($"{client.Session["Id"]} disconnected"); }); }
public void Setup() { _currentEventArgs = null; _connectedEventArgs = null; _uut = new UsbCharger(); //_uut.UnlockedDoor(); _uut.currentValueEvent += (o, args) => { _currentEventArgs = args; }; _uut.connectedValueEvent += (o, args) => { _connectedEventArgs = args; }; }
private async void AtcServer_Connected(object sender, ConnectedEventArgs e) { viewModel.AtcConnectionState = ConnectionState.Connected; viewModel.AtcCallsign = e.Callsign; // Register ATC specific events hub.On <string, AircraftStatus>("UpdateAircraft", async(connectionId, aircraftStatus) => { await atcServer.SendPositionAsync(aircraftStatus.Callsign, aircraftStatus.Transponder, aircraftStatus.Latitude, aircraftStatus.Longitude, aircraftStatus.Altitude, aircraftStatus.GroundSpeed, aircraftStatus.TransponderMode switch { TransponderMode.Standby => AtcTransponderMode.Standby, TransponderMode.ModeC => AtcTransponderMode.ModeC, TransponderMode.Ident => AtcTransponderMode.Ident, _ => AtcTransponderMode.Standby }); });
public void con_OnClientConnected(object sender, ConnectedEventArgs e) { try { ses = e.NetworkSession; ses.OnHandshakeHandler += new EventHandler <HandshakeEventArgs>(ses_OnInitPacketHandler); ses.OnPacketRecvHandler += new EventHandler <PacketEventArgs>(ses_OnPacketRecvHandler); ses.OnPacketSendHandler += new EventHandler <PacketEventArgs>(ses_OnPacketSendHandler); //ses.OnDisconnectedHandler += new EventHandler<DisconnectedEventArgs>(ses_OnDisconnect); ses.addDisconnectHandler(new EventHandler <DisconnectedEventArgs>(ses_OnDisconnect)); return; } catch { updateLog("[Connection] Initial response error"); //forceDisconnect(true, 1, false, "Initial Reponse error"); } }
public void Connected_MultipleSubscribedEvents_CalledInOrderUntilOneSetsDisconnectErrorToNonNull() { bool event1Called = false; bool event2Called = false; var event2Error = new Error(); bool event3Called = false; var event3Error = new Error(); var listener = new TestListener(LoggerTests.BlackHole); listener.Connected += (sender, args) => { Assert.IsFalse(event1Called); Assert.IsFalse(event2Called); Assert.IsFalse(event3Called); event1Called = true; }; listener.Connected += (sender, args) => { Assert.IsTrue(event1Called); Assert.IsFalse(event2Called); Assert.IsFalse(event3Called); event2Called = true; args.DisconnectError = event2Error; }; listener.Connected += (sender, args) => { Assert.IsTrue(event1Called); Assert.IsTrue(event2Called); Assert.IsFalse(event3Called); event3Called = true; args.DisconnectError = event3Error; }; var cea = new ConnectedEventArgs(null); listener.Test_OnConnected(cea); Assert.IsTrue(event1Called); Assert.IsTrue(event2Called); Assert.IsFalse(event3Called); Assert.AreSame(event2Error, cea.DisconnectError); }
public TestRequestSenderTests() { this.connectionInfo = new TestHostConnectionInfo { Endpoint = IPAddress.Loopback + ":123", Role = ConnectionRole.Client, Transport = Transport.Sockets }; this.mockChannel = new Mock <ICommunicationChannel>(); this.mockServer = new Mock <ICommunicationEndPoint>(); this.mockDataSerializer = new Mock <IDataSerializer>(); this.testRequestSender = new TestableTestRequestSender(this.mockServer.Object, this.connectionInfo, this.mockDataSerializer.Object, new ProtocolConfig { Version = DUMMYPROTOCOLVERSION }); this.connectedEventArgs = new ConnectedEventArgs(this.mockChannel.Object); this.mockDiscoveryEventsHandler = new Mock <ITestDiscoveryEventsHandler2>(); this.mockExecutionEventsHandler = new Mock <ITestRunEventsHandler>(); this.testRunCriteriaWithSources = new TestRunCriteriaWithSources(new Dictionary <string, IEnumerable <string> >(), "runsettings", null, null); }
private async void MController_Connected(IPenClient sender, ConnectedEventArgs args) { MaxForce = args.MaxForce; await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { ToggleControls(this.Content, true); if (sender.PenController?.Protocol == Protocols.V1) { textBox.Text = String.Format("Firmware Version : {0}", args.FirmwareVersion); } else { textBox.Text = String.Format("Mac : {0}\r\n\r\nName : {1}\r\n\r\nSubName : {2}\r\n\r\nFirmware Version : {3}\r\n\r\nProtocol Version : {4}", args.MacAddress, args.DeviceName, args.SubName, args.FirmwareVersion, args.ProtocolVersion); txtPenName.Text = args.SubName; } }); _client.StopLEAdvertisementWatcher(); }
private void Add(ConnectionPair connectionPair) { var client = connectionPair.Client; var connectedEventArgs = new ConnectedEventArgs(client); Error error = OnConnected(connectedEventArgs); if (error != null) { logger.Site().Information("{0}: Rejecting connection {1} because {2}:{3}.", logname, client.Id, error.error_code, error.message); throw new SimpleInMemProtocolErrorException( "Connection rejected", details: error, innerException: null); } lock (connectionsLock) { connectionPairs.Add(connectionPair.Id, connectionPair); } }
public static void AcceptCallback(IAsyncResult ar) { Debug.WriteLine("AcceptCallback"); // Get the socket that handles the client request. StateObject state = (StateObject)ar.AsyncState; Socket handler = state.listenSocket; Socket newSocket = handler.EndAccept(ar); // Create the state object. state.workSocket = newSocket; // Start reading data StartReadPacket(state); // Notify a new person connected var e = new ConnectedEventArgs(); ConnectedEvent.Invoke(null, e); }
protected override ICommunicationChannel SetupChannel(out ConnectedEventArgs connectedEvent) { ICommunicationChannel channel = null; ConnectedEventArgs clientConnectedEvent = null; ManualResetEvent waitEvent = new ManualResetEvent(false); this.socketServer.ClientConnected += (sender, eventArgs) => { clientConnectedEvent = eventArgs; channel = eventArgs.Channel; waitEvent.Set(); }; var connectionInfo = this.socketServer.Start(); this.ConnectToServer(int.Parse(connectionInfo)).GetAwaiter().GetResult(); waitEvent.WaitOne(); connectedEvent = clientConnectedEvent; return(channel); }
private void connectToolStripButton_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; this.JiraAccount = new JiraAccount(); this.JiraAccount.ServerUrl = this.jiraServerToolStripComboBox.Text; this.JiraAccount.User = this.userNameToolStripTextBox.Text; this.JiraAccount.Password = this.passwordToolStripTextBox.Text; this.JiraClient = new JiraClient(this.JiraAccount); try { this.JiraClient.GetProjects(); } catch (Exception) { string failure = "Failure to connect to JIRA Cloud!"; MessageBox.Show(failure, "Failure to conntct to Jira", MessageBoxButtons.OK, MessageBoxIcon.Error); this.JiraAccount = null; this.JiraClient = null; return; } this.disconnectToolStripButton.Enabled = true; this.connectToolStripButton.Enabled = false; this.jiraServerToolStripComboBox.Enabled = false; this.userNameToolStripTextBox.Enabled = false; this.passwordToolStripTextBox.Enabled = false; Properties.Settings.Default.JiraServer = this.jiraServerToolStripComboBox.Text; Properties.Settings.Default.JiraUserName = this.userNameToolStripTextBox.Text; Properties.Settings.Default.JiraPassword = this.passwordToolStripTextBox.Text; Properties.Settings.Default.Save(); ConnectedEventArgs connectedEventArgs = new ConnectedEventArgs(); connectedEventArgs.JiraClient = this.JiraClient; OnConnectedToJiraClient(connectedEventArgs); }
private void Connected(object sender, ConnectedEventArgs e) { if (InvokeRequired) { Invoke(_connected, sender, e); return; } HMessage remoteEndPointPkt = Connection.Local.ReceivePacketAsync().Result; e.HotelServer = ConnectionPg.HotelServer = HotelEndPoint.Parse(remoteEndPointPkt.ReadString().Split('\0')[0], remoteEndPointPkt.ReadInteger()); e.IsFakingPolicyRequest = (e.HotelServer.Hotel == HHotel.Unknown); ConnectionPg.IsReceiving = true; Text = $"Tanji ~ Connected[{e.HotelServer}]"; TopMost = PacketLoggerUI.TopMost; PacketLoggerUI.RevisionTxt.Text = ("Revision: " + Game.Revision); PacketLoggerUI.Show(); PacketLoggerUI.WindowState = FormWindowState.Normal; BringToFront(); }
private static void EventSink_Connected(ConnectedEventArgs e) { PlayerMobile pm = e.Mobile as PlayerMobile; if (pm != null) { pm.m_SessionStart = DateTime.Now; pm.BedrollLogout = false; pm.LastOnline = DateTime.Now; } DisguiseTimers.StartTimer(e.Mobile); }
public void WorkSurfaceContextViewModel_EnvironmentModelIsConnectedChanged_True_DebugStatusNotChanged() { //------------Setup for test-------------------------- var mockedConn = new Mock<IEnvironmentConnection>(); mockedConn.Setup(conn => conn.ServerEvents).Returns(new Mock<IEventPublisher>().Object); var mockEnvironmentModel = new Mock<IEnvironmentModel>(); mockEnvironmentModel.Setup(model => model.Connection).Returns(mockedConn.Object); var environmentModel = mockEnvironmentModel.Object; var workSurfaceContextViewModel = CreateWorkSurfaceContextViewModel(environmentModel); var connectedEventArgs = new ConnectedEventArgs { IsConnected = true }; workSurfaceContextViewModel.DebugOutputViewModel.DebugStatus = DebugStatus.Executing; //------------Execute Test--------------------------- mockEnvironmentModel.Raise(model => model.IsConnectedChanged += null, connectedEventArgs); //------------Assert Results------------------------- Assert.AreEqual(DebugStatus.Executing, workSurfaceContextViewModel.DebugOutputViewModel.DebugStatus); }
public void WorkSurfaceContextViewModel_EnvironmentModelIsConnectedChanged_False_DebugStatusFinished() { //------------Setup for test-------------------------- var workSurfaceKey = new WorkSurfaceKey(); var mockWorkSurfaceViewModel = new Mock<IWorkflowDesignerViewModel>(); var mockedConn = new Mock<IEnvironmentConnection>(); mockedConn.Setup(conn => conn.ServerEvents).Returns(new Mock<IEventPublisher>().Object); var mockEnvironmentModel = new Mock<IEnvironmentModel>(); mockEnvironmentModel.Setup(model => model.Connection).Returns(mockedConn.Object); var environmentModel = mockEnvironmentModel.Object; mockWorkSurfaceViewModel.Setup(model => model.EnvironmentModel).Returns(environmentModel); var workSurfaceViewModel = mockWorkSurfaceViewModel.As<IWorkSurfaceViewModel>().Object; var connectedEventArgs = new ConnectedEventArgs { IsConnected = false }; var workSurfaceContextViewModel = new WorkSurfaceContextViewModel(workSurfaceKey, workSurfaceViewModel) { DebugOutputViewModel = { DebugStatus = DebugStatus.Executing } }; //------------Execute Test--------------------------- mockEnvironmentModel.Raise(model => model.IsConnectedChanged += null, connectedEventArgs); //------------Assert Results------------------------- Assert.AreEqual(DebugStatus.Finished, workSurfaceContextViewModel.DebugOutputViewModel.DebugStatus); }
private static void HoloNETClient_OnConnected(object sender, ConnectedEventArgs e) { Console.WriteLine(string.Concat("Connected to ", e.EndPoint)); Console.WriteLine(""); }
private static void EventSink_Connected( ConnectedEventArgs e ) { Account acc = e.Mobile.Account as Account; if ( acc == null ) return; if ( acc.Young && acc.m_YoungTimer == null ) { acc.m_YoungTimer = new YoungTimer( acc ); acc.m_YoungTimer.Start(); } }
private void SocketConnected(object sender, ConnectedEventArgs e) { if (_sendBuffer.Count > 0) { Send(_sendBuffer.ToArray()); _sendBuffer.Clear(); } byte[] buffer = new byte[BufferSize]; _socket.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback(ReceivedCallback), new State(_socket, buffer)); }
private static void EventSink_Connected(ConnectedEventArgs e) { var pm = e.Mobile as PlayerMobile; if (pm != null) { pm.SessionStart = DateTime.UtcNow; if (pm.Quest != null) { pm.Quest.StartTimer(); } pm.BedrollLogout = false; pm.LastOnline = DateTime.UtcNow; } DisguiseTimers.StartTimer(e.Mobile); //Timer.DelayCall<Mobile>( TimeSpan.Zero, ClearSpecialMovesCallback, e.Mobile ); }
public void DeployViewModel_SourceServerDisconnected_ClearsConflictingNodes() { var mockSourceServer = new Mock<IEnvironmentModel>(); mockSourceServer.Setup(server => server.Connection.AppServerUri).Returns(new Uri("http://localhost")); mockSourceServer.Setup(server => server.IsConnected).Returns(true); mockSourceServer.Setup(server => server.IsAuthorizedDeployFrom).Returns(true); mockSourceServer.Setup(server => server.IsAuthorizedDeployTo).Returns(true); mockSourceServer.Setup(a => a.AuthorizationService).Returns(_authService.Object); Mock<IEnvironmentModel> destEnv; Mock<IEnvironmentModel> destServer; var deployViewModel = SetupDeployViewModel(out destEnv, out destServer); deployViewModel.SelectedDestinationServer = destServer.Object; deployViewModel.SelectedSourceServer = mockSourceServer.Object; var target = new PartialNaviationViewModel(deployViewModel.Target); deployViewModel.Target = target; deployViewModel.HasItemsToDeploy = (sourceDeployItemCount, destinationDeployItemCount) => true; destEnv.Setup(e => e.IsAuthorizedDeployTo).Returns(true); Assert.IsFalse(deployViewModel.SourceServerHasDropped); mockSourceServer.Setup(server => server.IsConnected).Returns(false); var connectedEventArgs = new ConnectedEventArgs { IsConnected = false }; deployViewModel.SourceEnvironmentConnectedChanged(this, connectedEventArgs); Assert.IsTrue(target.ClearCalled); }
private void ProxyConnected(object sender, ConnectedEventArgs e) { if (e.Result) { Messenger.Default.Send(new NotificationMessage(ChatViewShow)); } else { EnterEnabled = true; ShowMessageBox(e.Message); } }
/// <summary> /// Admin port is connected. /// </summary> private void AdminPortOnConnectedEvent(object sender, ConnectedEventArgs connectedEventArgs) { _isConnected = true; Log.Error("IQFeed.AdminPortOnConnectedEvent(): ADMIN PORT CONNECTED!"); }
public void InvokeConnected( ConnectedEventArgs e ) { if ( Connected != null ) Connected( e ); }
private static void OnConnected(ConnectedEventArgs e) { // we delay adding the IPAddress to give us time to check for it in the WelcomeTimer if (e.Mobile != null && e.Mobile.NetState != null) new IPLogTimer(e.Mobile.NetState.Address).Start(); }
/// <summary> /// The handle connected. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void HandleConnected(object sender, ConnectedEventArgs e) { this.SetIsConnected(e.Connected); }
void OnConnected(object source, ConnectedEventArgs e){ //Update connection button state UpdateConnectionButton (e.IsConnected); if(e.IsConnected) BluetoothLEHardwareInterface.Log ("**** New Connection: " + e.ConnectedDevice + " ****"); else BluetoothLEHardwareInterface.Log ("**** Disconnected ****"); }
/// <summary> /// The handle connected. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void HandleConnected(object sender, ConnectedEventArgs e) { this.SetIsConnected(e.Connected); if (e.Connected) { this.GetIsDebugEnabled(); } else { if (this.isDebugEnabled) { this.IsDebugEnabled = false; } } }
protected virtual void OnConnectedEvent(ConnectedEventArgs e) { if (ConnectedEvent != null) ConnectedEvent(this, e); }
private void OnConnected(ConnectedEventArgs e) { if (Connected != null) Connected(this, e); }
private static void EventSink_Connected( ConnectedEventArgs e ) { PlayerMobile pm = e.Mobile as PlayerMobile; if ( pm != null ) { pm.m_SessionStart = DateTime.Now; if ( pm.m_Quest != null ) pm.m_Quest.StartTimer(); pm.BedrollLogout = false; pm.LastOnline = DateTime.Now; } DisguiseTimers.StartTimer( e.Mobile ); Timer.DelayCall( TimeSpan.Zero, new TimerStateCallback( ClearSpecialMovesCallback ), e.Mobile ); }
/// <summary> /// Admin port is connected. /// </summary> private void AdminPortOnConnectedEvent(object sender, ConnectedEventArgs connectedEventArgs) { _isConnected = true; Log.Error("IQFeed.AdminPortOnConnectedEvent(): ADMIN PORT CONNECTED!"); }
private void HoloOASIS_OnConnected(object sender, ConnectedEventArgs e) { HoloNETClient.GetHolochainInstancesAsync(); }
public void DeployViewModel_SourceAndDestinationServerDisconnected_BothPropertiesTrue() { var mockSourceServer = new Mock<IEnvironmentModel>(); mockSourceServer.Setup(server => server.Connection.AppServerUri).Returns(new Uri("http://localhost")); mockSourceServer.Setup(server => server.IsConnected).Returns(true); mockSourceServer.Setup(server => server.IsAuthorizedDeployFrom).Returns(true); mockSourceServer.Setup(server => server.IsAuthorizedDeployTo).Returns(true); mockSourceServer.Setup(a => a.AuthorizationService).Returns(_authService.Object); Mock<IEnvironmentModel> destEnv; Mock<IEnvironmentModel> destServer; var deployViewModel = SetupDeployViewModel(out destEnv, out destServer); deployViewModel.SelectedDestinationServer = destServer.Object; deployViewModel.SelectedSourceServer = mockSourceServer.Object; deployViewModel.HasItemsToDeploy = (sourceDeployItemCount, destinationDeployItemCount) => true; destEnv.Setup(e => e.IsAuthorizedDeployTo).Returns(true); destEnv.Setup(server => server.IsConnected).Returns(true); Assert.IsFalse(deployViewModel.DestinationServerHasDropped); var connectedEventArgs = new ConnectedEventArgs { IsConnected = false }; destEnv.Setup(server => server.IsConnected).Returns(false); mockSourceServer.Setup(server => server.IsConnected).Returns(false); destEnv.Raise(model => model.IsConnectedChanged += null, connectedEventArgs); mockSourceServer.Raise(model => model.IsConnectedChanged += null, connectedEventArgs); Assert.IsTrue(deployViewModel.DestinationServerHasDropped); Assert.IsTrue(deployViewModel.SourceServerHasDropped); Assert.IsTrue(deployViewModel.ShowServerDisconnectedMessage); Assert.AreEqual("Source and Destination servers have disconnected.", deployViewModel.ServerDisconnectedMessage); }
private void FireOnConnect(ConnectedEventArgs c) { Log("EVENT Connected:"); if (OnConnect != null) { if (_synchContext == null) { OnConnect(this, c); } else { _synchContext.BeginInvoke(new EventHandler<ConnectedEventArgs>(OnConnect), this, c); } } }
void OnConnected(object source, ConnectedEventArgs e) { //Update connection button state UpdateConnectionButton (e.IsConnected); if(e.IsConnected) manager.Log ("**** New Connection: " + e.ConnectedDevice + " ****"); else manager.Log ("**** Disconnected ****"); }