public Login(DockPanel dockPanel, WelcomeScreen welcome) { InitializeComponent(); assembly = Assembly.Load("VisualUNITY"); rm = new ResourceManager("VisualUNITY.Languages.language", assembly); cultureInfo = new CultureInfo(Properties.Settings.Default.language); string pathToDBFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\VisualUnity\Unity.mdf"; localDbConnection = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=" + pathToDBFile + ";Integrated Security=True"); panel = dockPanel; welcomeScreen = welcome; Snackbar.MessageQueue = myMessageQueue; if (Properties.Settings.Default.signedIn) { MainPage mainPage = new MainPage(); welcomeScreen.Close(); mainPage.Show(); } }
private void timer1_Tick(object sender, EventArgs e) { Properties.Settings.Default.userFirstTime = true; Properties.Settings.Default.signedIn = false; Properties.Settings.Default.Save(); try { if (Properties.Settings.Default.signedIn) { openProjectSelected(); } else { WelcomeScreen welcomeScreen = new WelcomeScreen(); welcomeScreen.Show(); } } catch { } dispatcherTimer.Stop(); this.Close(); }