To reproduce:
Have a RadDock with a docked ToolWindow. Undock the ToolWindow by double-clicking it and dock it back. Now undock it by dragging it. If you now check the FloatingWindows collection you will see that there are two windows with the same name.
Workaround:
When iterating the windows, skip duplicates:
HashSet<string> iteratedWindows = new HashSet<string>();
foreach (FloatingWindow win in this.radDock1.FloatingWindows)
{
if (iteratedWindows.Contains(win.Text))
{
return;
}
win.Visible = hide;
iteratedWindows.Add(win.Text);
}
Resolution:
The FloatingWindows property gets a list of the floating windows, can contain duplicates, empty or hidden toolwindows which are used internally as re-dock targets. Use the ActiveFloatingWindows property instead of it.