partial void RomDirButton(NSObject sender) { var openPanel = new NSOpenPanel { CanChooseFiles = false, CanChooseDirectories = true, Title = "Select ROM Directory" }; if (openPanel.RunModal() == 1) { directory = openPanel.DirectoryUrl.Path; RomDirField.StringValue = directory; List <string> dirEntries = new List <string>(NSFileManager.DefaultManager.GetDirectoryContent(directory, out romDirError)); romDir.DirList.Clear(); romDir.romDict.Clear(); romDir.DirList.AddRange(dirEntries); foreach (string entry in dirEntries) { bool isDir = false; if (NSFileManager.DefaultManager.FileExists($"{directory}/{entry}", ref isDir) && isDir) { romDir.DirList.Remove(entry); } else { romDir.romDict.Add(entry, new RomId($"{directory}/{entry}")); } } RomDirTable.ReloadData(); } //NSWindow window = new NSWindow { }; //openPanel.BeginSheet(window, result => //{ // if (result == 1) // { // } // window.EndSheet(window); //}); }
void ReleaseDesignerOutlets() { if (AddRadioButton != null) { AddRadioButton.Dispose(); AddRadioButton = null; } if (AddXtoByteField != null) { AddXtoByteField.Dispose(); AddXtoByteField = null; } if (AutoEndCheckbox != null) { AutoEndCheckbox.Dispose(); AutoEndCheckbox = null; } if (ByteCorruptionView != null) { ByteCorruptionView.Dispose(); ByteCorruptionView = null; } if (EmulatorField != null) { EmulatorField.Dispose(); EmulatorField = null; } if (EmulatorLabel != null) { EmulatorLabel.Dispose(); EmulatorLabel = null; } if (EmulatorSelectButtonOutlet != null) { EmulatorSelectButtonOutlet.Dispose(); EmulatorSelectButtonOutlet = null; } if (EnableCpuJamCheckbox != null) { EnableCpuJamCheckbox.Dispose(); EnableCpuJamCheckbox = null; } if (EndByteDownButton != null) { EndByteDownButton.Dispose(); EndByteDownButton = null; } if (EndByteField != null) { EndByteField.Dispose(); EndByteField = null; } if (EndByteLabel != null) { EndByteLabel.Dispose(); EndByteLabel = null; } if (EndByteUpButton != null) { EndByteUpButton.Dispose(); EndByteUpButton = null; } if (EveryNthByteField != null) { EveryNthByteField.Dispose(); EveryNthByteField = null; } if (IncrementField != null) { IncrementField.Dispose(); IncrementField = null; } if (RangeDownButton != null) { RangeDownButton.Dispose(); RangeDownButton = null; } if (RangeUpButton != null) { RangeUpButton.Dispose(); RangeUpButton = null; } if (ReplaceByteXwithYByteXField != null) { ReplaceByteXwithYByteXField.Dispose(); ReplaceByteXwithYByteXField = null; } if (ReplaceByteXwithYByteYField != null) { ReplaceByteXwithYByteYField.Dispose(); ReplaceByteXwithYByteYField = null; } if (ReplaceRadioButton != null) { ReplaceRadioButton.Dispose(); ReplaceRadioButton = null; } if (RomDirField != null) { RomDirField.Dispose(); RomDirField = null; } if (RomDirTable != null) { RomDirTable.Dispose(); RomDirTable = null; } if (RomDirTableColumn != null) { RomDirTableColumn.Dispose(); RomDirTableColumn = null; } if (RomSaveField != null) { RomSaveField.Dispose(); RomSaveField = null; } if (ShiftRightRadioButton != null) { ShiftRightRadioButton.Dispose(); ShiftRightRadioButton = null; } if (ShiftRightXBytesField != null) { ShiftRightXBytesField.Dispose(); ShiftRightXBytesField = null; } if (StartByteDownButton != null) { StartByteDownButton.Dispose(); StartByteDownButton = null; } if (StartByteField != null) { StartByteField.Dispose(); StartByteField = null; } if (StartByteUpButton != null) { StartByteUpButton.Dispose(); StartByteUpButton = null; } if (ToggleByteCorruptionButton != null) { ToggleByteCorruptionButton.Dispose(); ToggleByteCorruptionButton = null; } if (ToggleEmulatorButton != null) { ToggleEmulatorButton.Dispose(); ToggleEmulatorButton = null; } if (ToggleOverwriteFile != null) { ToggleOverwriteFile.Dispose(); ToggleOverwriteFile = null; } }