Clément
Clément
CC#
Created by stigzler on 3/31/2024 in #help
Refactor this if statement without an additional method
:Ok:
23 replies
CC#
Created by stigzler on 3/31/2024 in #help
Refactor this if statement without an additional method
I think the truth is somewhere between
23 replies
CC#
Created by stigzler on 3/31/2024 in #help
Refactor this if statement without an additional method
From my perspective the second version is harder to read
23 replies
CC#
Created by stigzler on 3/31/2024 in #help
Refactor this if statement without an additional method
The original could be better, but at least is readable and is clear on what it's doing
23 replies
CC#
Created by stigzler on 3/31/2024 in #help
Refactor this if statement without an additional method
if (cell is not null)
{
return; // I guess ?
}

if (cell?.Pages.Count == 0)
{
SpaceControl!.Root.Children!.Remove(cell);
}

// ...create a new cell and place at the end of the root collection
cell = new KryptonWorkspaceCell();
SpaceControl!.Root.Children!.Add(cell);
if (cell is not null)
{
return; // I guess ?
}

if (cell?.Pages.Count == 0)
{
SpaceControl!.Root.Children!.Remove(cell);
}

// ...create a new cell and place at the end of the root collection
cell = new KryptonWorkspaceCell();
SpaceControl!.Root.Children!.Add(cell);
23 replies