Class ProjectConverter
- Namespace
- combit.Reporting.ProjectConverter
- Assembly
- combit.ListLabel31.ProjectConverter.dll
Provides functionality to convert ListLabel Classic projects to cross-platform format. Supports conversion from files or repositories to files, repositories, streams, or in-memory strings. Handles concurrent processing with configurable thread counts and automatic reference project discovery.
public class ProjectConverter : IDisposable
- Inheritance
-
ProjectConverter
- Implements
- Inherited Members
Examples
// Path to your existing LL project files
string sourcePath = @"C:\MyApp\ProjectFiles";
// Path where converted JSON files will be saved
string destinationPath = @"C:\MyApp\ConvertedProjectFiles";
// File extensions to convert - adjust as needed
string[] fileEndings = { ".lsr", ".lst", ".lbl", ".srt" };
// Create a new ProjectConverter
ProjectConverter projectConverter = new();
// Find all matching files in the source directory (including subfolders)
IEnumerable<string> files = Directory
.EnumerateFiles(sourcePath, "*.*", SearchOption.AllDirectories)
.Where(file => fileEndings
.Any(ext => file.EndsWith(ext, StringComparison.OrdinalIgnoreCase)));
ProjectConversionOptions projectConversionOptions = new ProjectConversionOptions
{
DestinationDirectory = destinationPath,
OutputExistsBehavior = OutputExistsBehavior.Overwrite,
WriteIndented = true,
ConvertReferencedProjects = false,
ImportData = "ProjectConverter"
};
// Convert all files in one batch
projectConverter.ConvertProjectsAndWriteToFile(files, projectConversionOptions);
Remarks
This class converts projects using a multi-stage pipeline:
- Project identifiers are resolved to project sources
- Project sources are opened and analyzed for references
- Projects are serialized to JSON and post-processed
- Converted projects are saved to the specified destination
The converter supports thread-safe concurrent processing and automatic cleanup of resources.
Constructors
ProjectConverter(IRepository?, IRepository?, ProjectConversionOptions?)
Initializes a new instance of the ProjectConverter class.
public ProjectConverter(IRepository? repositoryClassic = null, IRepository? repositoryCrossPlatform = null, ProjectConversionOptions? projectConversionOptions = null)
Parameters
repositoryClassicIRepositoryOptional repository containing ListLabel Classic projects to convert from.
repositoryCrossPlatformIRepositoryOptional repository where converted cross-platform projects will be stored.
projectConversionOptionsProjectConversionOptions?Optional default conversion options. If null, default options will be used.
Remarks
At least one repository should be provided if you plan to convert projects from or to repositories. File-based conversions do not require repositories.
Methods
ConvertProjectAndWriteToFile(string, bool?, string?, bool?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Converts a single project and writes the result to a file.
public void ConvertProjectAndWriteToFile(string projectIdentifier, bool? convertReferencedProjects = null, string? destinationDirectory = null, bool? flattenFolderStructure = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
destinationDirectorystringDirectory where converted files will be saved. If null, uses value from converter constructor if available, else uses default value.
flattenFolderStructurebool?Whether to flatten the folder structure of referenced projects. Only relevant when
convertReferencedProjectsis true and adestinationDirectoryis specified. If null, uses value from converter constructor if available, else uses default value.outputExistsBehaviorOutputExistsBehavior?Behavior when output file already exists. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToFile(string, ProjectConversionOptions, CancellationToken)
Converts a single project using specified options and writes the result to a file.
public void ConvertProjectAndWriteToFile(string projectIdentifier, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToFileAsync(string, bool?, string?, bool?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Asynchronously converts a single project and writes the result to a file.
public Task ConvertProjectAndWriteToFileAsync(string projectIdentifier, bool? convertReferencedProjects = null, string? destinationDirectory = null, bool? flattenFolderStructure = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
destinationDirectorystringDirectory where converted files will be saved. If null, uses value from converter constructor if available, else uses default value.
flattenFolderStructurebool?Whether to flatten the folder structure of referenced projects. Only relevant when
convertReferencedProjectsis true and adestinationDirectoryis specified. If null, uses value from converter constructor if available, else uses default value.outputExistsBehaviorOutputExistsBehavior?Behavior when output file already exists. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToFileAsync(string, ProjectConversionOptions, CancellationToken)
Asynchronously converts a single project using specified options and writes the result to a file.
public Task ConvertProjectAndWriteToFileAsync(string projectIdentifier, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToRepository(string, bool?, string?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Converts a single project and stores the result in the cross-platform repository.
public void ConvertProjectAndWriteToRepository(string projectIdentifier, bool? convertReferencedProjects = null, string? importData = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
importDatastringUser data to associate with the import operation.
outputExistsBehaviorOutputExistsBehavior?Behavior when output already exists in repository. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectAndWriteToRepository(string, ProjectConversionOptions, CancellationToken)
Converts a single project using specified options and stores the result in the cross-platform repository.
public void ConvertProjectAndWriteToRepository(string projectIdentifier, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectAndWriteToRepositoryAsync(string, bool?, string?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Asynchronously converts a single project and stores the result in the cross-platform repository.
public Task ConvertProjectAndWriteToRepositoryAsync(string projectIdentifier, bool? convertReferencedProjects = null, string? importData = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
importDatastringUser data to associate with the import operation.
outputExistsBehaviorOutputExistsBehavior?Behavior when output already exists in repository. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectAndWriteToRepositoryAsync(string, ProjectConversionOptions, CancellationToken)
Asynchronously converts a single project using specified options and stores the result in the cross-platform repository.
public Task ConvertProjectAndWriteToRepositoryAsync(string projectIdentifier, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectAndWriteToStream(string, Stream, int?, bool?, CancellationToken)
Converts a single project and writes the JSON result to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public void ConvertProjectAndWriteToStream(string projectIdentifier, Stream outputStream, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToStream(string, Stream, ProjectConversionOptions, CancellationToken)
Converts a single project using specified options and writes the JSON result to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public void ConvertProjectAndWriteToStream(string projectIdentifier, Stream outputStream, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToStreamAsync(string, Stream, int?, bool?, CancellationToken)
Asynchronously converts a single project and writes the JSON result to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task ConvertProjectAndWriteToStreamAsync(string projectIdentifier, Stream outputStream, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToStreamAsync(string, Stream, ProjectConversionOptions, CancellationToken)
Asynchronously converts a single project using specified options and writes the JSON result to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task ConvertProjectAndWriteToStreamAsync(string projectIdentifier, Stream outputStream, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToString(string, int?, bool?, CancellationToken)
Converts a single project and returns the JSON result as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public IReadOnlyList<string> ConvertProjectAndWriteToString(string projectIdentifier, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- IReadOnlyList<string>
A read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToString(string, ProjectConversionOptions, CancellationToken)
Converts a single project using specified options and returns the JSON result as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public IReadOnlyList<string> ConvertProjectAndWriteToString(string projectIdentifier, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- IReadOnlyList<string>
A read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToStringAsync(string, int?, bool?, CancellationToken)
Asynchronously converts a single project and returns the JSON result as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task<IReadOnlyList<string>> ConvertProjectAndWriteToStringAsync(string projectIdentifier, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task<IReadOnlyList<string>>
A task that returns a read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectAndWriteToStringAsync(string, ProjectConversionOptions, CancellationToken)
Asynchronously converts a single project using specified options and returns the JSON result as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task<IReadOnlyList<string>> ConvertProjectAndWriteToStringAsync(string projectIdentifier, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifierstringIdentifier of the project to convert (file path or repository URI).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task<IReadOnlyList<string>>
A task that returns a read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid project or I/O errors.
ConvertProjectsAndWriteToFile(IEnumerable<string>, bool?, string?, bool?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Converts multiple projects and writes the results to files.
public void ConvertProjectsAndWriteToFile(IEnumerable<string> projectIdentifiers, bool? convertReferencedProjects = null, string? destinationDirectory = null, bool? flattenFolderStructure = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
destinationDirectorystringDirectory where converted files will be saved. If null, uses value from converter constructor if available, else uses default value.
flattenFolderStructurebool?Whether to flatten the folder structure of referenced projects. Only relevant when
convertReferencedProjectsis true and adestinationDirectoryis specified. If null, uses value from converter constructor if available, else uses default value.outputExistsBehaviorOutputExistsBehavior?Behavior when output file already exists. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToFile(IEnumerable<string>, ProjectConversionOptions, CancellationToken)
Converts multiple projects and writes the results to files.
public void ConvertProjectsAndWriteToFile(IEnumerable<string> projectIdentifiers, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToFileAsync(IEnumerable<string>, bool?, string?, bool?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Asynchronously converts multiple projects and writes the results to files.
public Task ConvertProjectsAndWriteToFileAsync(IEnumerable<string> projectIdentifiers, bool? convertReferencedProjects = null, string? destinationDirectory = null, bool? flattenFolderStructure = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
destinationDirectorystringDirectory where converted files will be saved. If null, uses value from converter constructor if available, else uses default value.
flattenFolderStructurebool?Whether to flatten the folder structure of referenced projects. Only relevant when
convertReferencedProjectsis true and adestinationDirectoryis specified. If null, uses value from converter constructor if available, else uses default value.outputExistsBehaviorOutputExistsBehavior?Behavior when output file already exists. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToFileAsync(IEnumerable<string>, ProjectConversionOptions, CancellationToken)
Asynchronously converts multiple projects using specified options and writes the results to files.
public Task ConvertProjectsAndWriteToFileAsync(IEnumerable<string> projectIdentifiers, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToRepository(IEnumerable<string>, bool?, string?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Converts multiple projects and stores the results in the cross-platform repository.
public void ConvertProjectsAndWriteToRepository(IEnumerable<string> projectIdentifiers, bool? convertReferencedProjects = null, string? importData = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
importDatastringUser data to associate with the import operation.
outputExistsBehaviorOutputExistsBehavior?Behavior when output already exists in repository. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectsAndWriteToRepository(IEnumerable<string>, ProjectConversionOptions, CancellationToken)
Converts multiple projects using specified options and stores the results in the cross-platform repository.
public void ConvertProjectsAndWriteToRepository(IEnumerable<string> projectIdentifiers, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectsAndWriteToRepositoryAsync(IEnumerable<string>, bool?, string?, OutputExistsBehavior?, int?, bool?, CancellationToken)
Asynchronously converts multiple projects and stores the results in the cross-platform repository.
public Task ConvertProjectsAndWriteToRepositoryAsync(IEnumerable<string> projectIdentifiers, bool? convertReferencedProjects = null, string? importData = null, OutputExistsBehavior? outputExistsBehavior = null, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
convertReferencedProjectsbool?Whether to automatically discover and convert referenced projects. If null, uses value from converter constructor if available, else uses default value.
importDatastringUser data to associate with the import operation.
outputExistsBehaviorOutputExistsBehavior?Behavior when output already exists in repository. If null, uses value from converter constructor if available, else uses default value.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectsAndWriteToRepositoryAsync(IEnumerable<string>, ProjectConversionOptions, CancellationToken)
Asynchronously converts multiple projects using specified options and stores the results in the cross-platform repository.
public Task ConvertProjectsAndWriteToRepositoryAsync(IEnumerable<string> projectIdentifiers, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when no cross-platform repository is configured or conversion fails.
ConvertProjectsAndWriteToStream(IEnumerable<string>, Stream, int?, bool?, CancellationToken)
Converts multiple projects and writes the JSON results to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public void ConvertProjectsAndWriteToStream(IEnumerable<string> projectIdentifiers, Stream outputStream, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToStream(IEnumerable<string>, Stream, ProjectConversionOptions, CancellationToken)
Converts multiple projects using specified options and writes the JSON results to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public void ConvertProjectsAndWriteToStream(IEnumerable<string> projectIdentifiers, Stream outputStream, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToStreamAsync(IEnumerable<string>, Stream, int?, bool?, CancellationToken)
Asynchronously converts multiple projects and writes the JSON results to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task ConvertProjectsAndWriteToStreamAsync(IEnumerable<string> projectIdentifiers, Stream outputStream, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToStreamAsync(IEnumerable<string>, Stream, ProjectConversionOptions, CancellationToken)
Asynchronously converts multiple projects using specified options and writes the JSON results to a stream as an array. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task ConvertProjectsAndWriteToStreamAsync(IEnumerable<string> projectIdentifiers, Stream outputStream, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
outputStreamStreamStream where the JSON array will be written. Stream position will be reset to 0 after writing.
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task
A task representing the asynchronous conversion operation.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToString(IEnumerable<string>, int?, bool?, CancellationToken)
Converts multiple projects and returns the JSON results as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public IReadOnlyList<string> ConvertProjectsAndWriteToString(IEnumerable<string> projectIdentifiers, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- IReadOnlyList<string>
A read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToString(IEnumerable<string>, ProjectConversionOptions, CancellationToken)
Converts multiple projects using specified options and returns the JSON results as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public IReadOnlyList<string> ConvertProjectsAndWriteToString(IEnumerable<string> projectIdentifiers, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- IReadOnlyList<string>
A read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToStringAsync(IEnumerable<string>, int?, bool?, CancellationToken)
Asynchronously converts multiple projects and returns the JSON results as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task<IReadOnlyList<string>> ConvertProjectsAndWriteToStringAsync(IEnumerable<string> projectIdentifiers, int? threadCount = null, bool? writeIndented = null, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
threadCountint?Number of concurrent threads to use for processing. If null, uses value from converter constructor if available, else uses default value.
writeIndentedbool?Whether to format JSON output with indentation. If null, uses value from converter constructor if available, else uses default value.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task<IReadOnlyList<string>>
A task that returns a read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
ConvertProjectsAndWriteToStringAsync(IEnumerable<string>, ProjectConversionOptions, CancellationToken)
Asynchronously converts multiple projects using specified options and returns the JSON results as a list of strings. Referenced projects are not converted, as they can not be resolved to a new location, and existing references are being removed.
public Task<IReadOnlyList<string>> ConvertProjectsAndWriteToStringAsync(IEnumerable<string> projectIdentifiers, ProjectConversionOptions projectConversionOptions, CancellationToken cancellationToken = default)
Parameters
projectIdentifiersIEnumerable<string>Collection of project identifiers to convert (file paths or repository URIs).
projectConversionOptionsProjectConversionOptionsComplete set of conversion options to use.
cancellationTokenCancellationTokenToken to cancel the conversion operation.
Returns
- Task<IReadOnlyList<string>>
A task that returns a read-only list containing the JSON representation of each converted project.
Exceptions
- ListLabelException
Thrown when conversion fails due to invalid projects or I/O errors.
Dispose()
Releases all resources used by the ProjectConverter.
public void Dispose()
Remarks
This method calls the virtual Dispose(bool) method, passing in true, and then suppresses finalization of the instance.
Dispose(bool)
Releases the unmanaged resources used by the ProjectConverter and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposingbooltrue to release both managed and unmanaged resources; false to release only unmanaged resources.