Skip to content

Handler C#

Valentin Chatelain edited this page May 18, 2017 · 2 revisions

Use case

className: GoM.Core.FSAnalyzer.CSharpFolderHandler

This class inherits from BaseProjectFolderHandler, its goal is to analyze a folder containing a CSharp project and create a new Project with the c# project's dependencies.

A C# project store it's dependencies either in a regular .csproj file or in a packages.config file depending on the type of the project. To solve this problem, the CSharpFolderHandler will dispatch the work to a PackagesConfigHandler or to a CsProjHandler according to the project's type.

Methods

Sniff: This method analyze the root folder given in the constructor and determine the project's type, the Sniff method can call another Handler to dispatch the work.

Read: The Read method parses dependencies of the project and return a new Project object containing the discovered dependencies.