static void Main() { FileViewer f = new FileViewer(); f.Test(); ((IWindow)f).Close(); IWindow w = new FileViewer(); w.Close(); }