Re: Использование замыканий
От: Uzzy Россия  
Дата: 09.09.10 11:24
Оценка:
Здравствуйте, AlexDP, Вы писали:

как-то так
        private void Export(string extension, Action<string> export)
        {
            TableView viewToWorkWith = GetViewToExportOrPrint();
            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
            dlg.FileName = "Document"; // Default file name
            dlg.DefaultExt = string.Format(".{0}", extension); // Default file extension
            dlg.Filter = string.Format(".{0}|*.{0}", extension); // Filter files by extension

            Nullable<bool> result = dlg.ShowDialog();

            // Process save file dialog box results
            if (result == true)
            {
                // Save document
                string filename = dlg.FileName;

                export(filename);
            }
        }
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.