public static void Show(IServiceProvider serviceProvider, Control parent, NiFindOptions options, NiFindOptions optionsMask, INiFindTarget findTarget) { if (serviceProvider == null) throw new ArgumentNullException("serviceProvider"); if (parent == null) throw new ArgumentNullException("parent"); if (findTarget == null) throw new ArgumentNullException("findTarget"); var control = parent.Controls.OfType<FindControl>().SingleOrDefault(); if (control == null) { control = new FindControl { Anchor = AnchorStyles.Right, Site = new SiteProxy(serviceProvider) }; control.Left = parent.ClientSize.Width - control.Width; parent.Controls.Add(control); } control._findManager.FindTarget = findTarget; control._findManager.SetOptions(options, optionsMask); control._findWhat.Focus(); }
public bool IsNewFindTarget(INiFindTarget findTarget) { if (findTarget == null) { throw new ArgumentNullException("findTarget"); } return(_findTargetsSeen.Add(findTarget)); }
public static FindState Create(FindManager manager, NiFindOptions options, INiFindTarget findTarget) { return new FindState(findTarget) { Options = options, FindWhat = manager._view.GetFindWhatText(), ReplaceWith = manager._view.GetReplaceWithText(), LookIn = manager._view.GetLookInText(), LookInFileTypes = manager._view.GetLookAtFileTypesText() }; }
private bool PerformSingleFind(INiFindTarget findTarget) { bool reset = _state.IsNewFindTarget(findTarget); NiFindResult result; ErrorUtil.ThrowOnFailure(findTarget.Find( _state.FindWhat, _state.Options, reset, _findHelper, out result )); if (result == NiFindResult.Found) { return(true); } return(false); }
public SingleTargetIterator(INiFindTarget findTarget) { _findTarget = findTarget; }
public static FindState Create(FindManager manager, NiFindOptions options, INiFindTarget findTarget) { return(new FindState(findTarget) { Options = options, FindWhat = manager._view.GetFindWhatText(), ReplaceWith = manager._view.GetReplaceWithText(), LookIn = manager._view.GetLookInText(), LookInFileTypes = manager._view.GetLookAtFileTypesText() }); }
private FindState(INiFindTarget findTarget) { _findTarget = findTarget; BeforeFirst = true; }
public bool IsNewFindTarget(INiFindTarget findTarget) { if (findTarget == null) throw new ArgumentNullException("findTarget"); return _findTargetsSeen.Add(findTarget); }
private bool PerformSingleFind(INiFindTarget findTarget) { bool reset = _state.IsNewFindTarget(findTarget); NiFindResult result; ErrorUtil.ThrowOnFailure(findTarget.Find( _state.FindWhat, _state.Options, reset, _findHelper, out result )); if (result == NiFindResult.Found) return true; return false; }
public static void Show(IServiceProvider serviceProvider, Control parent, NiFindOptions options, NiFindOptions optionsMask, INiFindTarget findTarget) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (parent == null) { throw new ArgumentNullException("parent"); } if (findTarget == null) { throw new ArgumentNullException("findTarget"); } var control = parent.Controls.OfType <FindControl>().SingleOrDefault(); if (control == null) { control = new FindControl { Anchor = AnchorStyles.Right, Site = new SiteProxy(serviceProvider) }; control.Left = parent.ClientSize.Width - control.Width; parent.Controls.Add(control); } control._findManager.FindTarget = findTarget; control._findManager.SetOptions(options, optionsMask); control._findWhat.Focus(); }