public string[] OpenFiles() { OpenFileDialog ofd = new OpenFileDialog("XML dosyasını seçiniz..", "xml", "xml", "dialog", OpenFileDialog.OpenFileDialogFlags.AllowMultiple); if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return(null); } Ed.WriteMessage("\nFile selected was \"{0}\".", ofd.Filename ); return(ofd.GetFilenames()); }
public static List <string> GetAllCadFilesFromDialog() { List <string> results = new List <string>(); OpenFileDialog ofd = new OpenFileDialog("Select Cad Files To Process", null, "dwg; dxf; *", "SelectFileToProcess", OpenFileDialog.OpenFileDialogFlags.AllowMultiple); System.Windows.Forms.DialogResult dr = ofd.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.OK) { results = ofd.GetFilenames().ToList(); } return(results); }
public void NetLoad() { #if NET20 OpenFileDialog dlg = new OpenFileDialog( "选择.Net程序集", "", "dll", "NetLoadX", OpenFileDialog.OpenFileDialogFlags.AllowMultiple); var res = dlg.ShowDialog(); if (res == System.Windows.Forms.DialogResult.OK) { foreach (var name in dlg.GetFilenames()) { Loader loader = new Loader(); loader.Add(name.Replace("\\", "/")); } } #elif NET45 Autodesk.AutoCAD.Windows.OpenFileDialog dlg = new Autodesk.AutoCAD.Windows.OpenFileDialog( "选择.Net程序集", "", "dll", "NetLoadX", Autodesk.AutoCAD.Windows.OpenFileDialog.OpenFileDialogFlags.AllowMultiple); var res = dlg.ShowDialog(); if (res == System.Windows.Forms.DialogResult.OK) { foreach (var name in dlg.GetFilenames()) { Loader loader = new Loader(); loader.Add(name.Replace("\\", "/")); } } #endif }