public PCNetworkManager(NetworkMessagesEventArgs incomingMsg) { SQLiteCRUD sql = new SQLiteCRUD(ConnectionStringManager.GetConnectionString(ConnectionStringManager.DataBases.PCControllerDB)); NetworkMessageModel netMsg = new NetworkMessageModel(); if (incomingMsg.IncomingMessage is null) { netMsg.IncomingMessage = string.Empty; } else { netMsg.IncomingMessage = incomingMsg.IncomingMessage; } if (incomingMsg.OutgoingMessage is null) { netMsg.IncomingMessage = string.Empty; } else { netMsg.OutgoingMessage = incomingMsg.OutgoingMessage; } if (incomingMsg.RemoteIP is null) { incomingMsg.RemoteIP = string.Empty; } else { netMsg.RemoteIP = incomingMsg.RemoteIP; } if (incomingMsg.IncomingMessage is null) { incomingMsg.Timestamp = string.Empty; } else { netMsg.Timestamp = incomingMsg.Timestamp; } if (incomingMsg.RemotePort is null) { incomingMsg.RemotePort = string.Empty; } else { netMsg.RemotePort = incomingMsg.RemotePort; } netMsg.UDPPort = incomingMsg.UDPPort; this.UDPPortSet?.Invoke(this, incomingMsg.UDPPort); sql.InsertNetMessage(netMsg); }
public MainWindowViewModel() { //ProdutoFinVM = new FinancialProductViewModel(); sqlitecrud = new SQLiteCRUD(); simplecrud = new SimpleCRUD(); ProdutoFinVM = new FinancialProductViewModel(sqlitecrud); //ProdutoFinVM = new FinancialProductViewModel(simplecrud); this.InstanciaComandos(); _stringTeste = "ValorDefault"; }