private async Task SaveGroupsToFile() { string infoSourceName = ""; switch (dataSourceMode) { case SmartDataSourceMode.SD_SOURCE_EVENTS: await smartDataProvider.SaveEventGroups(SourceItems.Select(x => x.ToSmartGroupsJsonData()).ToList()); infoSourceName = "Events"; break; case SmartDataSourceMode.SD_SOURCE_ACTIONS: await smartDataProvider.SaveActionsGroups(SourceItems.Select(x => x.ToSmartGroupsJsonData()).ToList()); infoSourceName = "Actions"; break; case SmartDataSourceMode.SD_SOURCE_TARGETS: await smartDataProvider.SaveTargetsGroups(SourceItems.Select(x => x.ToSmartGroupsJsonData()).ToList()); infoSourceName = "Targets"; break; } History.MarkAsSaved(); messageBoxService.ShowDialog(new MessageBoxFactory <bool>().SetTitle("Success!") .SetMainInstruction($"Editor successfully saved definitions of {infoSourceName} Groups!") .SetIcon(MessageBoxIcon.Information) .WithOkButton(true) .Build()); }
private async Task SaveGroupsToFile() { await conditionDataProvider.SaveConditionGroups(SourceItems.Select(x => x.ToConditionGroupsJsonData()).ToList()); History.MarkAsSaved(); }