Beispiel #1
0
        public static void SaveLastConfiguration(string ConnectionStringSource, string ConnectionStringDestination)
        {
            Project lastUsedProject = AllProjects.Find(proj => proj.ConnectionStringSource.ToLower() == ConnectionStringSource.ToLower() && proj.ConnectionStringDestination.ToLower() == ConnectionStringDestination.ToLower());

            AllProjects.ForEach(proj => proj.WasLastUsed = false);

            if (lastUsedProject == null)
            {
                lastUsedProject = new Project()
                {
                    ConnectionStringDestination = ConnectionStringDestination,
                    ConnectionStringSource      = ConnectionStringSource,
                    Type        = ProjectType.SQLServer,
                    WasLastUsed = true
                };
                lastUsedProject.Id = Project.AllProjects.Count + 1;
                Add(lastUsedProject);
            }
            else
            {
                lastUsedProject.WasLastUsed                 = true;
                lastUsedProject.ConnectionStringSource      = ConnectionStringSource;
                lastUsedProject.ConnectionStringDestination = ConnectionStringDestination;
                Update(lastUsedProject);
            }

            //Serialize the changes back down to disk
            Serialize();
        }
Beispiel #2
0
 public void RandomizeProjectIds()
 {
     AllSolutionFolders.ForEach(x => x.ProjectId = Guid.NewGuid());
     AllProjects.ForEach(x => x.ProjectId        = Guid.NewGuid());
 }