JD2022-TU1/main/tools/framework/JD.TeaBoxAddinSystem/Bootstrap/ICommandLineHandler.cs

49 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
namespace JD.TeaBoxAddinSystem.Bootstrap
{
/// <summary>
/// Interface for classes that can custom handle the command line arguments.
/// </summary>
public interface ICommandLineHandler : IBootstrapCommand, ICommandLineHelpTopic
{
#region Properties
/// <summary>
/// Gets whether the handler will be executed even if no argument from <see cref="ArgumentNames"/> are present.
/// </summary>
bool ExecuteEvenWhenNoArgumentNamesPresent { get; }
/// <summary>
/// Gets whether the application should quit after this command has executed.
/// </summary>
/// <remarks>
/// This is always called just after the <see cref="IBootstrapCommand.Execute"/> method.
/// </remarks>
/// <returns>True if the application should quit immediately (bypassing any remaining commands)</returns>
bool QuitAfterExecuted { get; }
/// <summary>
/// Name of the main arguments of this handler.
/// </summary>
IEnumerable<string> ArgumentNames { get; }
#endregion
#region Methods
/// <summary>
/// Initializes the handler.
/// </summary>
/// <remarks>
/// This method is called once at the start of the program. You can validate the arguments here
/// and throw <see cref="ArgumentException"/>s if needed.
/// </remarks>
/// <returns>True if the application should start in command line mode (no GUI).</returns>
/// <exception cref="ArgumentException">An argument is invalid.</exception>
bool Initialize();
#endregion
}
}