예제 #1
0
        protected void ParseMsCsProj(string fname)
        {
            string projectName = System.IO.Path.GetFileNameWithoutExtension(fname);
            string csprojPath  = System.IO.Path.GetFileName(fname);
            string projectGuid = "";

            CsprojInfo pi = new CsprojInfo(m_bIsUnix, m_bIsMcs, projectName, projectGuid, csprojPath);

            projNameInfo[projectName] = pi;
            projGuidInfo[projectGuid] = pi;
        }
        protected void ParseSolution(string fname, IProgressMonitor monitor)
        {
            FileStream fis = new FileStream(fname, FileMode.Open, FileAccess.Read, FileShare.Read);

            using (StreamReader reader = new StreamReader(fis))
            {
                while (true)
                {
                    string s = reader.ReadLine();
                    Match  match;

                    match = ProjectRegex.Match(s);
                    if (match.Success)
                    {
                        string projectName = match.Groups[2].Value;
                        string csprojPath  = match.Groups[3].Value;
                        string projectGuid = match.Groups[4].Value;

                        try
                        {
                            if (csprojPath.EndsWith(".csproj") && !csprojPath.StartsWith("http://"))
                            {
                                csprojPath = MapPath(Path.GetDirectoryName(fname), csprojPath);
                                CsprojInfo pi = new CsprojInfo(m_bIsUnix, m_bIsMcs, projectName, projectGuid, csprojPath);
                                projNameInfo[projectName] = pi;
                                projGuidInfo[projectGuid] = pi;
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(GettextCatalog.GetString("Could not import project:") + csprojPath);
                            Console.WriteLine(ex.ToString());
                            monitor.ReportError(GettextCatalog.GetString("Could not import project:") + csprojPath, ex);
                            throw;
                        }
                    }

                    if (s.StartsWith("Global"))
                    {
                        break;
                    }
                }
            }
        }
예제 #3
0
        protected void ParseSolution(string fname)
        {
            FileStream fis = new FileStream(fname,FileMode.Open, FileAccess.Read, FileShare.Read);
            StreamReader reader = new StreamReader(fis);
            Regex regex = new Regex(@"Project\(""\{(.*)\}""\) = ""(.*)"", ""(.*)"", ""(\{.*\})""");

            while (true)
            {
                string s = reader.ReadLine();
                Match match;

                match = regex.Match(s);
                if (match.Success)
                {
                    string projectName = match.Groups[2].Value;
                    string csprojPath = match.Groups[3].Value;
                    string projectGuid = match.Groups[4].Value;

                    if (csprojPath.EndsWith (".csproj") && !csprojPath.StartsWith("http://"))
                    {
                        CsprojInfo pi = new CsprojInfo (m_bIsUnix, m_bIsMcs, projectName, projectGuid, csprojPath);

                        projNameInfo[projectName] = pi;
                        projGuidInfo[projectGuid] = pi;
                    }
                }

                if (s.StartsWith("Global"))
                {
                    break;
                }
            }
        }
예제 #4
0
        protected void ParseMsCsProj(string fname)
        {
            string projectName = System.IO.Path.GetFileNameWithoutExtension (fname);
            string csprojPath = System.IO.Path.GetFileName (fname);
            string projectGuid = "";

            CsprojInfo pi = new CsprojInfo (m_bIsUnix, m_bIsMcs, projectName, projectGuid, csprojPath);

            projNameInfo[projectName] = pi;
            projGuidInfo[projectGuid] = pi;
        }
		protected void ParseSolution(string fname, IProgressMonitor monitor)
		{
			FileStream fis = new FileStream(fname,FileMode.Open, FileAccess.Read, FileShare.Read);
			using (StreamReader reader = new StreamReader(fis)) {
				while (true)
				{
					string s = reader.ReadLine();
					Match match;

					match = ProjectRegex.Match(s);
					if (match.Success)
					{
						string projectName = match.Groups[2].Value;
						string csprojPath = match.Groups[3].Value;
						string projectGuid = match.Groups[4].Value;

						try {
							if (csprojPath.EndsWith (".csproj") && !csprojPath.StartsWith("http://"))
							{
								csprojPath = MapPath (Path.GetDirectoryName (fname), csprojPath);
								CsprojInfo pi = new CsprojInfo (m_bIsUnix, m_bIsMcs, projectName, projectGuid, csprojPath);
								projNameInfo[projectName] = pi;
								projGuidInfo[projectGuid] = pi;
							}
						} catch (Exception ex) {
							Console.WriteLine (GettextCatalog.GetString ("Could not import project:") + csprojPath);
							Console.WriteLine (ex.ToString ());
							monitor.ReportError (GettextCatalog.GetString ("Could not import project:") + csprojPath, ex);
							throw;
						}
					}

					if (s.StartsWith("Global"))
					{
						break;
					}
				}
			}
		}