Search code examples
c#dockpanel-suite

Call a Method in a DockPanel Document


I have a dictionary list of forms which are Documents within DockPanelSuite (Windows Forms) When a button on the main form is pressed all the document's "Contents" contained in the first control (ScintillaNet Editor instance) of the Document Form should be saved.

However, accessing the Save() method of the form is proving frustrating. Currently this is the code:

private void btnCompile_Click(object sender, EventArgs e)
        {
            // Save the Project.
           foreach(var editor in EditorList)
            {
                if(editor.Key.StartsWith(CurrentProjectModel.Name))
                {
                    FrmCodeEditor fce = new FrmCodeEditor();
                    fce = (FrmCodeEditor)editor.Value;
                    fce.Save();
                }
            }

            IDA.Controllers.CLI.Exec exec = new Controllers.CLI.Exec();
            exec.ExecuteCompiler();
        }

editor is the name of the form, EditorList is the Dictionary which contains a list of all active Documents. However, the fce.Save is not being found.

Question All I want to do is iterate through all the open Documents which are FrmEditor types and call their Save method. How can I do that?


Solution

  • As it turned out - the method I was trying to call was static. However, this was not being flagged in intellisense.