bool _GetTextToFind(out _TextToFind f, bool forReplace, bool noRecent = false) { _errorProvider.Clear(); f = default; f.findText = _tFind.Text; if (f.findText.Length == 0) { return(false); } f.matchCase = _cCase.Checked; if (_cRegex.Checked) { try { var fl = RXFlags.MULTILINE; if (!f.matchCase) { fl |= RXFlags.CASELESS; } f.rx = new ARegex(f.findText, flags: fl); } catch (ArgumentException e) { _SetErrorProvider(_tFind, e.Message); return(false); } } else { f.wholeWord = _cWord.Checked; } if (forReplace) { f.replaceText = _tReplace.Text; } _AddToRecent(f, noRecent); if (forReplace && (Panels.Editor.ZActiveDoc?.Z.IsReadonly ?? true)) { return(false); } return(true); }
void _readNativeStruct() { if (_ptrSciTextToFind != IntPtr.Zero) _sciTextToFind = (_TextToFind)Marshal.PtrToStructure(_ptrSciTextToFind, typeof(_TextToFind)); }