Ejemplo n.º 1
0
        public static void UnRegisterFromEvents(SearchEventHandler searchRequestDelegate
                                                , ReplaceEventHandler replaceRequestDelegate
                                                , FormClosedEventHandler formClosedDelegate)
        {
            if (_instance == null)
            {
                return;
            }


            if (searchRequestDelegate != null)
            {
                SearchRequested -= searchRequestDelegate;
            }

            if (replaceRequestDelegate != null)
            {
                ReplaceRequested -= replaceRequestDelegate;
            }

            if (formClosedDelegate != null)
            {
                _searchAndReplaceFormClosed -= formClosedDelegate;
            }
        }
Ejemplo n.º 2
0
        //public void FirstSpectraSearchAsync(ICollection<ISpectrum> spectra) {
        public void FirstSpectraSearchAsync(List <ISpectrum> spectra)
        {
            _isBusy = true;
            _cancel = false;
            SearchEventHandler seh = new SearchEventHandler(FirstSpectraSearch);

            seh.BeginInvoke(spectra, null, null);
        }
Ejemplo n.º 3
0
        protected virtual void OnButtonSearchClick(SearchEventArgs e)
        {
            SearchEventHandler ButtonSearchClickHandler = (SearchEventHandler)Events[ButtonSearchClickObject];

            if (ButtonSearchClickHandler != null)
            {
                ButtonSearchClickHandler(this, e);
            }
        }
Ejemplo n.º 4
0
        // Search methods made Synchronously
        public static void WaitForCompletion(this ISearch search)
        {
            var reset = new ManualResetEvent(search.IsComplete);
            SearchEventHandler handler = (s, e) => reset.Set();

            search.Complete += handler;
            reset.WaitOne();
            search.Complete -= handler;
        }
Ejemplo n.º 5
0
        private void OnSearchPerformed(SearchEventArgs args)
        {
            SearchEventHandler handler = SearchPerformed;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Ejemplo n.º 6
0
 public void SetSerachEvent(SearchEventHandler searchEvent)
 {
     SearchEvent += searchEvent;
 }