using System;
using System.Threading;
using System.Threading.Tasks;
using MonoDevelop.Components;
namespace MonoDevelop.ConnectedServices
{
///
/// Represents a section to be displayed to the user in the service details page.
/// Each section has the concept of being able to be "added" to the project, that is,
/// to perform some action on the project when 'AddToProject' is invoked. It is the responsibility of
/// the section to store state appropriately and to return `IsAdded` as required. The Added event should
/// be trigered once the task has been completed.
///
/// Sections that do not perform an action on the project can return false from CanBeAdded.
///
public interface IConfigurationSection
{
///
/// Gets the service for this section
///
IConnectedService Service { get; }
///
/// Gets the name of the section to display to the user.
///
string DisplayName { get; }
///
/// Gets the description of the section to display to the user.
///
string Description { get; }
///
/// Gets a value indidating if this section represents something that can be added to the project.
///
bool CanBeAdded { get; }
///
/// Gets a value indicating that whatever changes to the project that can be added by this section have been added.
///
bool IsAdded { get; }
///
/// Gets the widget to display to the user
///
Control GetSectionWidget ();
///
/// Performs the tasks necessary to add the components that this section represents to the project
///
Task AddToProject (CancellationToken token);
///
/// Occurs when the status of the section changes
///
event EventHandler StatusChanged;
}
}