/// <summary>
 /// Display the file open dialog prompting for a text file to insert and
 /// insert the file contents into the existing text string.
 /// </summary>
 public void ImportTextFile()
 {
     var fileName = string.Empty;
       #if ON_OS_MAC
       using (var panel = new MonoMac.AppKit.NSOpenPanel())
       {
     panel.CanChooseFiles = true;
     panel.CanChooseDirectories = false;
     var rc = panel.RunModal ();
     if (rc < 1)
       return;
     var urls = panel.Urls;
     if (null == urls || urls.Length < 1)
       return;
     fileName = urls [0].Path;
       }
       #endif
       #if ON_OS_WINDOWS
       var dlg = new Microsoft.Win32.OpenFileDialog();
       dlg.Filter = Rhino.UI.LOC.STR("Text files (*.txt)|*.txt|All files (*.*)|*.*");
       if (true == dlg.ShowDialog(Window))
     fileName = dlg.FileName;
       #endif
       if (string.IsNullOrWhiteSpace(fileName)) return;
       var fileContents = System.IO.File.ReadAllText(fileName);
       InsertText(fileContents);
 }
 public void MacBrowseForFileButtonClick()
 {
     using (var panel = new MonoMac.AppKit.NSOpenPanel())
       {
     panel.CanChooseFiles = true;
     panel.CanChooseDirectories = false;
     var rc = panel.RunModal ();
     if (rc < 1)
       return;
     var urls = panel.Urls;
     if (null == urls || urls.Length < 1)
       return;
     var fileName = urls [0].Path;
     OnFileButtonClicked (fileName);
       }
 }