object ReadProjectFile(FilePath fileName, IProgressMonitor monitor)
        {
            XmlTextReader reader = null;

            try
            {
                reader = new XmlTextReader(new StreamReader(fileName));
                reader.MoveToContent();

                string version = reader.GetAttribute("version");
                if (version == null)
                {
                    version = reader.GetAttribute("fileversion");
                }

                DataSerializer serializer    = new DataSerializer(MD1ProjectService.DataContext, fileName);
                IProjectReader projectReader = null;

                monitor.BeginTask(GettextCatalog.GetString("Loading project: {0}", fileName), 1);

                if (version == "2.0" || version == "2.1")
                {
                    projectReader = new ProjectReaderV2(serializer);
                    return(projectReader.ReadProject(reader));
                }
                else
                {
                    throw new MD1UnknownProjectVersion(fileName, version);
                }
            }
            catch (Exception ex)
            {
                monitor.ReportError(GettextCatalog.GetString("Could not load project: {0}", fileName), ex);
                throw;
            }
            finally
            {
                monitor.EndTask();
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
		object ReadProjectFile (FilePath fileName, IProgressMonitor monitor)
		{
			XmlTextReader reader = null;
			try {
				reader = new XmlTextReader (new StreamReader (fileName));
				reader.MoveToContent ();

				string version = reader.GetAttribute ("version");
				if (version == null) version = reader.GetAttribute ("fileversion");
				
				DataSerializer serializer = new DataSerializer (MD1ProjectService.DataContext, fileName);
				IProjectReader projectReader = null;
				
				monitor.BeginTask (GettextCatalog.GetString ("Loading project: {0}", fileName), 1);
				
				if (version == "2.0" || version == "2.1") {
					projectReader = new ProjectReaderV2 (serializer);
					return projectReader.ReadProject (reader);
				}
				else
					throw new MD1UnknownProjectVersion (fileName, version);
			} catch (Exception ex) {
				monitor.ReportError (GettextCatalog.GetString ("Could not load project: {0}", fileName), ex);
				throw;
			} finally {
				monitor.EndTask ();
				if (reader != null)
					reader.Close ();
			}
		}