In DocumentsPanel
I have a few open forms, each of them is of another kind. How do I save the files that were open in a loop.
In this case, this works.
using (StreamWriter file = new StreamWriter ("files.txt"))
{
foreach (FormEditor doc in dockPanel1.Documents)
{
file.WriteLine (doc.SuperFileName);
}
}
file.Close ();
However, if a second FormBrowser
is opened in the panel, error pops up when you try to save the documents. The error is stated below:
Unable to cast object of type 'App1.FormBrowser' to type 'App1.FormEditor'.