//----------------------------------------------------------------------- // // Copyright (c) aliasvault. All rights reserved. // Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information. // //----------------------------------------------------------------------- namespace AliasVault.Client.Services; /// /// Service to handle shared state for quick create form data. /// public class QuickCreateStateService { /// /// Event that is raised when the state has been updated and the consumer should reinitialize. /// public event Action? OnChange; /// /// Gets or sets the service name from quick create. /// public string? ServiceName { get; set; } /// /// Gets or sets the service URL from quick create. /// public string? ServiceUrl { get; set; } /// /// Gets or sets the item type from quick create. /// public string? ItemType { get; set; } /// /// Gets or sets the folder ID to pre-select when creating a new item. /// public Guid? FolderId { get; set; } /// /// Notifies subscribers that the state has changed. /// public void NotifyStateChanged() => OnChange?.Invoke(); /// /// Clears the stored state. /// public void ClearState() { ServiceName = null; ServiceUrl = null; ItemType = null; FolderId = null; } }