Saturday 15 May 2010

monomac - Xamarin.Mac Unified API and System.Windows.Forms -


I recently upgraded to Xamarin.Mac integrated API. Before the upgrade, I was using the FolderBrowserDialog by using System.Windows.Forms . By upgrading, I no longer have access to System.Windows.Forms namespace. I contacted customer support and suggested to refer to the original API. So I added it with my dependencies. The appearance of that nujet removed the intelligence errors for the following code:

  var dir = Environment.SpecialFolder.MyPictures.ToString (); Var dlg = new CommonOpenFileDialog (); Dlg.Title = "Skip subdirectory"; Dlg.IsFolderPicker = True; Dlg.InitialDirectory = dir; Dlg.AddToMostRecentlyUsedList = false; Dlg.AllowNonFileSystemItems = false; Dlg.DefaultDirectory = dir; Dlg.EnsureFileExists = True; Dlg.EnsurePathExists = True; Dlg.EnsureReadOnly = false; Dlg.EnsureValidNames = true; Dlg.Multiselect = false; Dlg.ShowPlacesList = True; If (dlg.ShowDialog () == CommonfileDialogRalt.Ok) {var folder = dlg.FileName; }  

but it casts at

There is no need for that nuzet, you can complete a FolderBrowserDialog with this code :

  NSOpenPanel openDlg = NSOpenPanel.OpenPanel; OpenDlg.Prompt = "Choose Directory"; // default for OpenOpen DLL.Conocos Directories = true; OpenDlg.CanChooseFiles = Incorrect; OpenDlg.Title = "Select Monitor Directory"; OpenDlg.other majority selection = false; OpenDlg.CanCreateDirectories = True; OpenDlg.ReleasedWhenClosed = true; OpenDlg.DirectoryUrl = New NSUrl (EnvironmentalGETFolderPath (System.Environment.SpecialFolder.UserProfile)); OpenDlg.Bgin (result => {var url = openDlg.Url}; if (result == 1) {// directory selected} and {// cancel}});  

No comments:

Post a Comment