private void ModernButton8_Click(object sender, EventArgs e) { try { var con = MainForm.Instance.CurrentDevice.GetConnection(); if (con != null) { // MainForm.ButtonCreator(); // ApplicationSettingsManager.Settings.coluna = Convert.ToInt32(coluna.Text); // ApplicationSettingsManager.Settings.linha= Convert.ToInt32(linha.Text); MatrizObject new_matriz = new MatrizObject(Convert.ToInt32(linha.Text), Convert.ToInt32(coluna.Text)); MainForm.Instance.CurrentDevice.CurrentProfile.Matriz = new_matriz; var matriz_packet = new MatrizPacket(MainForm.Instance.CurrentDevice.CurrentProfile); con.SendPacket(matriz_packet); } MainForm.Instance.MatrizGenerator(MainForm.Instance.CurrentDevice.CurrentProfile); } catch (Exception ea) { MessageBox.Show("Aguardando conexão com o device.." + ea); } }
public static void SelectCurrentDevicePerfil(Profile profile) { if (MainForm.Instance.CurrentDevice != null) { MainForm.Instance.Invoke(new Action(() => { var con = MainForm.Instance.CurrentDevice.GetConnection(); SelectPerfilMatriz(profile); DevicePersistManager.DeckDevicesFromConnection.FirstOrDefault().Value.CurrentProfile = profile; MainForm.Instance.MatrizGenerator(profile); var Matriz = new MatrizPacket(profile); con.SendPacket(Matriz); MainForm.Instance.CurrentDevice.CurrentProfile.Currentfolder = profile.Mainfolder; MainForm.Instance.ChangeToDevice(MainForm.Instance.CurrentDevice); DeviceSelected = profile; ApplicationSettingsManager.Settings.CurrentProfile = profile.Name; MainForm.Instance.RefreshAllButtons(true); })); } }