private void ExportFor(string type, string file) { if (SelectOption(type)) { Control main = EnsureViewInfo(); try { DoExport(file); ValidXmlFile(file); } finally { if (main != null) main.Dispose(); } } }