/// <summary> /// This method is used to read the content of a project file and get /// all the data neededfor UI and compilation. /// Current implementation always use CsprojReader. It will be changed /// as more project-readers will be developed. /// </summary> /// <param name = "filename"></param> /// <returns></returns> public BasicProject ReadProject(string filename) { //TODO: Add some logic here: check filename extension, if it is //.csproj use CsprojReader, check if it can open the file and read //the project or use an other IProjectReader if the current version //of .csproj is unknown to CsprojReader. //Get the appropiate reader for the filetype. //As filetype is always .csproj i'll just use CsprojReader. CsprojReader reader = new CsprojReader(); //TODO: Decide if this is needed. ReadProject should only be called after CanOpen, //so I may not need to check it again. if (!reader.CanOpen(filename)) return null; return reader.ReadProject(filename); }
/// <summary> /// This method is used to read the content of a project file and get /// all the data needed for UI and compilation. /// Current implementation always use CsprojReader. It will be changed /// as more project-readers will be developed. /// </summary> /// <param name="filename"></param> /// <returns></returns> public BasicProject ReadProject(string filename) { //TODO: Add some logic here: check filename extension, if it is //.csproj use CsprojReader, check if it can open the file and read //the project or use an other IProjectReader if the current version //of .csproj is unknown to CsprojReader. //Get the appropriate reader for the filetype. //As filetype is always .csproj I'll just use CsprojReader. CsprojReader reader = new CsprojReader(); //TODO: Decide if this is needed. ReadProject should only be called after CanOpen, //so I may not need to check it again. if (!reader.CanOpen(filename)) { return(null); } return(reader.ReadProject(filename)); }