public void OpenProject(ProjectPreload preLoadProject) { MainPanel.Visible = false; Loading_Title.Text = "Loading " + preLoadProject.Name; Loading_Title.Location = new Point((Width / 2) - (Loading_Title.Width / 2), Loading_Title.Location.Y); Loading_Title.Visible = true; Thread loadingTitleThread = new Thread(() => { int dots = 0; while (true) { Thread.Sleep(110); dots++; if (dots == 4) { dots = 1; } string str_dots = ""; for (int i = 0; i < dots; i++) { str_dots += "."; } try { Invoke(new MethodInvoker(delegate { Loading_Title.Text = "Loading " + preLoadProject.Name + str_dots; })); } catch (Exception e) { } } }); loadingTitleThread.Start(); new Thread(() => { Settings settings = Settings.LoadIDESettings(); Main main = new Main(); main.settings = settings; Project project = new Project(preLoadProject); main.project = project; settings.LoadProjectSettings(project); Thread.Sleep(1000); //Until we have heavy loading, want to show off loading screen :3 main.InitializeConsole(); main.Show(); loadingTitleThread.Abort(); try { Invoke(new MethodInvoker(delegate { Close(); })); } catch (Exception e) { Environment.Exit(0); } Application.Run(main); }).Start(); }
private void Open_Click(object sender, EventArgs e) { FolderBrowserDialog dialog = new FolderBrowserDialog(); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { string path = dialog.SelectedPath; string name = Path.GetDirectoryName(path); ProjectPreload project = new ProjectPreload(name, path); OpenProject(project); } }
private void LoadProjects() { Projects.Clear(); if (!Directory.Exists(WorkingDirectory)) { Directory.CreateDirectory(WorkingDirectory); return; } foreach (string dir in Directory.GetDirectories(WorkingDirectory)) { ProjectPreload p = new ProjectPreload(dir.Replace(WorkingDirectory, "").Substring(1), dir); Projects.Add(p); } RenderProjects(); }
public Project(ProjectPreload preload) { Name = preload.Name; WorkingDirectory = preload.WorkingDirectory; }