public void TearDown() { // Elimino il controller ed il database gestioneStazioniController.Dispose(); gestioneStazioniController = null; File.Delete(@"test_stazioni.db"); }
public void SetUp() { // Se il database esiste, lo elimino if (File.Exists(@"test_stazioni.db")) { File.Delete(@"test_stazioni.db"); } // Creo un nuovo controller gestioneStazioniController = new GestioneStazioniController("test_stazioni.db"); }
public RegistraStazioneForm(IGestioneStazioniController gestioneStazioniController) { InitializeComponent(); var materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = SismioColor.Scheme; this.registraStazione1.Controller = gestioneStazioniController; }
public Login(AutenticazioneController controller, IGestioneUtentiController gestioneUtentiController, IGestioneStazioniController stazioniController, IStoricoController storicoController, SorgenteFactory factory, GestoreEventi gestoreEventi) { InitializeComponent(); _controller = controller; _gestioneUtentiController = gestioneUtentiController; _stazioniController = stazioniController; _storicoController = storicoController; _factory = factory; _gestoreEventi = gestoreEventi; var materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = SismioColor.Scheme; this.background.BackColor = SismioColor.Scheme.DarkPrimaryColor; // // Load Font // byte[] fontData = Properties.Resources.RobotoMono_Bold; IntPtr fontPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(fontData.Length); System.Runtime.InteropServices.Marshal.Copy(fontData, 0, fontPtr, fontData.Length); uint dummy = 0; fonts.AddMemoryFont(fontPtr, Properties.Resources.RobotoMono_Bold.Length); AddFontMemResourceEx(fontPtr, (uint)Properties.Resources.RobotoMono_Bold.Length, IntPtr.Zero, ref dummy); System.Runtime.InteropServices.Marshal.FreeCoTaskMem(fontPtr); robotoMono = new Font(fonts.Families[0], 14.0F); this.textUsername.Font = robotoMono; this.title.Font = new Font(fonts.Families[0], 56.0F); // Focus at the startup this.ActiveControl = this.textUsername; // Precompilo il form this.textUsername.Text = "admin"; this.textPassword.Text = "admin"; // Carico la combo box CaricaSorgenti(); }
public MainForm(IGestioneUtentiController gestioneUtentiController, IGestioneStazioniController gestioneStazioniController, IStoricoController storico, ISorgente sorgente, GestoreEventi gestoreEventi, AutenticazioneController autenticazioneController) { InitializeComponent(); this.homeDashboard1.Sorgente = sorgente; this.homeDashboard1.GestoreEventi = gestoreEventi; this.homeDashboard1.GestioneStazioniController = gestioneStazioniController; this.storico1.StoricoController = storico; this.homeGestioneUtenti1.UtentiController = gestioneUtentiController; this.homeGestioneStazioni1.StazioniController = gestioneStazioniController; var materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = SismioColor.Scheme; this.navbar.BackColor = SismioColor.Scheme.DarkPrimaryColor; //this.BackColor = SismioColor.BackColor; this.tabControl.SelectedTab = this.tabDashboard; this.tabDashboard.BackColor = SismioColor.BackColor; this.tabGestioneStazioni.BackColor = SismioColor.BackColor; this.tabGestioneUtenti.BackColor = SismioColor.BackColor; this.tabStorico.BackColor = SismioColor.BackColor; // Nascondo i pulsanti in base ai permessi IUtente utenteCorrente = autenticazioneController.UtenteAttivo; if (utenteCorrente == null) { this.navGestioneStazioni.Visible = false; this.navGestioneUtenti.Visible = false; } else { this.navGestioneStazioni.Visible = utenteCorrente.PuoModificareStazioni(); this.navGestioneUtenti.Visible = utenteCorrente.PuoModificareUtenti(); } }
public CreatoreConnessioni(IGestioneStazioniController gestioneStazioniController) { _gestioneStazioniController = gestioneStazioniController; }