//unused
        public static Project LoadProject(string FileName)
        {
            //load xml
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load(FileName);

            //creat new project
            Project project = new Project();
            project.FileName = FileName;

            //folders
            XmlNodeList xnodes = xdoc.SelectNodes("project/folder");

            project.Folders = LoadFolders(xnodes);

            //build groups
            xnodes = xdoc.SelectNodes("project/buildgroup");

            project.BuildGroups = LoadBuildGroups(xnodes);

            //variables
            xnodes = xdoc.SelectNodes("project/variable");

            project.Variables = LoadVariables(xnodes);

            return project;
        }
 public void SerializeObject(string FileName, Project Project)
 {
     Stream stream = File.Open(FileName, FileMode.Create);
     BinaryFormatter bFormatter = new BinaryFormatter();
     bFormatter.Serialize(stream, Project);
     stream.Close();
 }
        private void OpenProject(string FileName)
        {
            try
            {
                Serializer ser = new Serializer();
                CurrentProject = ser.DeSerializeObject(FileName);

                LoadFolderList();
                LoadBuildGroupList();

                //enable toolbars etc
                buildToolStripMenuItem.Enabled = true;
                projectToolStripMenuItem.Enabled = true;
                mainToolStrip.Enabled = true;
            }
            catch (Exception)
            {
                MessageBox.Show("Error loading project.");
            }
        }