Ejemplo n.º 1
0
        private async Task SaveAsConfigAsync(string name, string description)
        {
            //Check if a file with this name already exist
            var hwDefs = await _client.GetAllHardwareDef();

            if (hwDefs.Any(hwdef => hwdef.Name == name))
            {
                NotifySystem.Default.ShowWarning("A save file with this name already exist on the server.");
                return;
            }

            var hwDef = new HardwareDefinitionDto
            {
                Name         = name,
                Description  = description,
                CreationTime = DateTime.UtcNow
            };

            await _client.SaveCurrentHardwareDef(hwDef);

            UnsavedChanges = false;

            _current           = hwDef;
            NameTextBlock.Text = GetDisplayFileName();
            _diagManager.CloseDialog();
        }