using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace EventSystemXMLCreator { public partial class ProjectLocation : Form { XMLCreator xmlCreator; string path = System.IO.Directory.GetCurrentDirectory(); public ProjectLocation() { InitializeComponent(); xmlCreator = new XMLCreator(); getCorrectFilePath(); } private void getCorrectFilePath() { int length = path.Length; string temp = "Desktop"; int x = path.IndexOf(temp) + temp.Length; path = path.Remove(x, length - x); } private void LocOpenFileButton_Click(object sender, EventArgs e) { openFileDialog1.Title = "Find your .csproj file of your program."; openFileDialog1.Filter = "XNA Files|*.csproj"; openFileDialog1.InitialDirectory = @"C:\"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { MessageBox.Show(openFileDialog1.FileName.ToString()); Globals.CSProjectLocation = openFileDialog1.FileName.ToString(); } this.Hide(); xmlCreator.Activate(); xmlCreator.Show(); } private void LocCancelButton_Click(object sender, EventArgs e) { this.Hide(); xmlCreator.Activate(); xmlCreator.Show(); } } }