public static SearchFiltersTooltip ShowTooltip(IServiceProvider serviceProvider, Control anchorControl, List <BoxItem> filters, SearchOperator ope) { if (anchorControl is null) { return(null); } if (!filters?.Any() ?? false) { return(null); } SearchFiltersTooltip newTT; lock (syncObj) { HideTooltip(); newTT = new SearchFiltersTooltip( serviceProvider.GetService <SearchDialogAdvanced>() , serviceProvider.GetService <IItemProvider>() , serviceProvider.GetService <IFontService>() , serviceProvider.GetService <IUIService>() , serviceProvider.GetService <ITranslationService>() ) { AnchorControl = anchorControl, Filters = filters, Operator = ope }; _Current = newTT; newTT.Show(); } return(newTT); }
public static void HideTooltip() { lock (syncObj) { if (_Current != null) { _Current.Close(); } _Current = null; } }