private static NUnitProject ConvertVSProject(string path)
        {
            NUnitProject project = new NUnitProject(Path.GetFullPath(path));
            project.Add(new VSProject(path));
			project.IsDirty = false;
            return project;
        }
Ejemplo n.º 2
0
        private static NUnitProject LegacyConvertVSSolution(string path)
        {
            NUnitProject project = new NUnitProject(Path.GetFullPath(path));

            string solutionDirectory = Path.GetDirectoryName(path);

            using (StreamReader reader = new StreamReader(path))
            {
                char[] delims    = { '=', ',' };
                char[] trimchars = { ' ', '"' };

                string line = reader.ReadLine();
                while (line != null)
                {
                    if (line.StartsWith("Project("))
                    {
                        string[] parts         = line.Split(delims);
                        string   vsProjectPath = parts[2].Trim(trimchars);

                        if (VSProject.IsProjectFile(vsProjectPath))
                        {
                            project.Add(new VSProject(Path.Combine(solutionDirectory, vsProjectPath)));
                        }
                    }

                    line = reader.ReadLine();
                }

                project.IsDirty = false;
                return(project);
            }
        }
Ejemplo n.º 3
0
        private static NUnitProject ConvertVSProject(string path)
        {
            NUnitProject project = new NUnitProject(Path.GetFullPath(path));

            project.Add(new VSProject(path));
            project.IsDirty = false;
            return(project);
        }
		public NUnitProject ConvertFrom(string path)
		{
			NUnitProject project = new NUnitProject( Path.GetFullPath( path ) );

			if ( VSProject.IsProjectFile(path) )
			{
				VSProject vsProject = new VSProject( path );
				project.Add( vsProject );
			}
			else if ( VSProject.IsSolutionFile(path) )
			{
				string solutionDirectory = Path.GetDirectoryName( path );
				using(StreamReader reader = new StreamReader( path ))
				{
					char[] delims = { '=', ',' };
					char[] trimchars = { ' ', '"' };

					string line = reader.ReadLine();
					while ( line != null )
					{
						if ( line.StartsWith( "Project" ) )
						{
							string[] parts = line.Split( delims );
							string vsProjectPath = parts[2].Trim(trimchars);
						
							if ( VSProject.IsProjectFile( vsProjectPath ) )
								project.Add( new VSProject( Path.Combine( solutionDirectory, vsProjectPath ) ) );
						}

						line = reader.ReadLine();
					}
				}
			}

			project.IsDirty = false;

			return project;
		}