/// <summary> /// Abre a conexão WebSocket com a informações passadas /// </summary> /// <param name="ServerURL">Servidor a ser realizada a conexão WebSocket</param> /// <param name="Credentials">Credenciais a serem utilizadas</param> public void Open(string ServerURL, Credentials Credentials) { //Criando objeto de conexão socket objWebSocket = new WebSocket(ServerURL, LogLevel.Trace); objWebSocket.OnOpen += objWebSocket_OnOpen; objWebSocket.OnClose += objWebSocket_OnClose; objWebSocket.OnError += objWebSocket_OnError; objWebSocket.OnMessage += objWebSocket_OnMessage; if (Credentials != null) { objWebSocket.SetCredentials(Credentials.UserName, Credentials.Password, false); } //Abrindo a conexão socket try { objWebSocket.Connect(); } catch (Exception ex) { throw ex; } //Disparando evento de conectando OnOpening?.Invoke(this); Thread thrConnect = new Thread(ValidConncetion); thrConnect.Start(); }
public Task Open([NotNull] MessageConfig config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } var task = OnOpening?.Invoke(config); return(task); }
public Task Open([NotNull] MessageConfig config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } if (OnOpening != null) { return(OnOpening.Invoke(config)); } return(Task.CompletedTask); }
private void Open(Popup popup) { popup.Configure(() => { typeof(PopupManager) .GetMethod("Close") .MakeGenericMethod(popup.GetType()) .Invoke(this, null); }); OnOpening.SafeInvoke(popup.GetType()); popup.AnimateIn(() => { OnOpened.SafeInvoke(popup.GetType()); }); }