C# Class NuGet.PackageReferenceFile

Show file Open project: themotleyfool/NuGet Class Usage Examples

Private Properties

Property Type Description
AddEntry void
DeleteEntry bool
FindEntry System.Xml.Linq.XElement
GetDocument System.Xml.Linq.XDocument
GetPackageReferences IEnumerable
SaveDocument void

Public Methods

Method Description
AddEntry ( string id, SemanticVersion version ) : void
AddEntry ( string id, SemanticVersion version, FrameworkName targetFramework ) : void
DeleteEntry ( string id, SemanticVersion version ) : bool

Deletes an entry from the file with matching id and version. Returns true if the file was deleted.

EntryExists ( string packageId, SemanticVersion version ) : bool
FindEntryWithLatestVersionById ( string id ) : PackageName
PackageReferenceFile ( IFileSystem fileSystem, string path ) : System
PackageReferenceFile ( string path ) : System

Private Methods

Method Description
AddEntry ( System.Xml.Linq.XDocument document, string id, SemanticVersion version, FrameworkName targetFramework ) : void
DeleteEntry ( System.Xml.Linq.XDocument document, string id, SemanticVersion version ) : bool
FindEntry ( System.Xml.Linq.XDocument document, string id, SemanticVersion version ) : System.Xml.Linq.XElement
GetDocument ( bool createIfNotExists = false ) : System.Xml.Linq.XDocument
GetPackageReferences ( ) : IEnumerable
SaveDocument ( System.Xml.Linq.XDocument document ) : void

Method Details

AddEntry() public method

public AddEntry ( string id, SemanticVersion version ) : void
id string
version SemanticVersion
return void

AddEntry() public method

public AddEntry ( string id, SemanticVersion version, FrameworkName targetFramework ) : void
id string
version SemanticVersion
targetFramework FrameworkName
return void

DeleteEntry() public method

Deletes an entry from the file with matching id and version. Returns true if the file was deleted.
public DeleteEntry ( string id, SemanticVersion version ) : bool
id string
version SemanticVersion
return bool

EntryExists() public method

public EntryExists ( string packageId, SemanticVersion version ) : bool
packageId string
version SemanticVersion
return bool

FindEntryWithLatestVersionById() public method

public FindEntryWithLatestVersionById ( string id ) : PackageName
id string
return PackageName

PackageReferenceFile() public method

public PackageReferenceFile ( IFileSystem fileSystem, string path ) : System
fileSystem IFileSystem
path string
return System

PackageReferenceFile() public method

public PackageReferenceFile ( string path ) : System
path string
return System