ISandcastle ProjectAdd File To Project Method
Add a new file build item to the project
Definition
Namespace: Sandcastle.Core.Project
Assembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2026.1.20.0
The new IFileItem
Assembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2026.1.20.0
C#
IFileItem AddFileToProject(
string sourceFile,
string destinationFile
)VB
Function AddFileToProject (
sourceFile As String,
destinationFile As String
) As IFileItemC++
IFileItem^ AddFileToProject(
String^ sourceFile,
String^ destinationFile
)F#
abstract AddFileToProject :
sourceFile : string *
destinationFile : string -> IFileItem Parameters
- sourceFile String
- The source filename
- destinationFile String
- The optional destination path. If empty, null, or it does not start with the project folder, the file is copied to the root folder of the project.
Return Value
IFileItemThe new IFileItem
Remarks
If the file does not exist in the project, it is copied to the destination path or project
folder if not already there. The default build action is determined based on the filename's
extension. If the file is already part of the project, the existing item is returned.