This commit is contained in:
2025-10-03 16:32:16 +02:00
parent 5016b3ed8d
commit 9f95bb23e6
8 changed files with 64 additions and 31 deletions

View File

@@ -151,28 +151,31 @@
private void OnNewName()
{
switch (Attached.Type)
if (Attached != null)
{
case AttachedDTO.TypeAttached.Position:
switch (Attached.Type)
{
CanAddPosition = false;
case AttachedDTO.TypeAttached.Position:
{
CanAddPosition = false;
Attached.Description = NewName!;
Attached.Description = NewName!;
Attached.Name = NewName!;
break;
}
case AttachedDTO.TypeAttached.Image:
{
var extension = Path.GetExtension(Attached.Name);
Attached.Name = NewName! + extension;
break;
}
case AttachedDTO.TypeAttached.Image:
{
var extension = Path.GetExtension(Attached.Name);
Attached.Name = NewName! + extension;
break;
break;
}
case AttachedDTO.TypeAttached.Document:
break;
default:
throw new ArgumentOutOfRangeException();
}
case AttachedDTO.TypeAttached.Document:
break;
default:
throw new ArgumentOutOfRangeException();
}
MudDialog.Close(Attached);