Esempio n. 1
0
        /// <summary>
        /// Starts search and when it is done opens the panel with results.
        /// </summary>
        /// <param name="sourcePanel">The result panel to open.</param>
        public void Invoke(Panel sourcePanel)
        {
            if (sourcePanel == null)
            {
                throw new ArgumentNullException("sourcePanel");
            }

            // panel with the file store
            var panel = new SuperPanel();

            // invoke
            IsCompleted = false;
            try
            {
                panel.Explorer.AddFiles(InvokeWithProgress());
            }
            finally
            {
                IsCompleted = true;
            }

            // complete panel
            panel.Escaping += OnPanelEscaping;
            panel.Title     = string.Format(null, Res.SearchTitle,
                                            FoundFileCount, ProcessedDirectoryCount, Stopping ? Res.StateStopped : Res.StateCompleted);

            // open panel, even empty
            panel.OpenChild(sourcePanel);
        }
Esempio n. 2
0
        /// <summary>
        /// Starts search in the background and opens the panel for results immediately.
        /// </summary>
        /// <param name="sourcePanel">The result panel to open.</param>
        public void InvokeAsync(Panel sourcePanel)
        {
            if (sourcePanel == null)
            {
                throw new ArgumentNullException("sourcePanel");
            }

            var panel = new SuperPanel();

            panel.Title = Res.Searching;

            // open panel (try)
            panel.OpenChild(sourcePanel);

            // start search
            (new Thread(InvokeAsyncWorker)).Start();

            // subscribe
            panel.Escaping += OnPanelEscaping;
            panel.Closed   += OnPanelClosed;
            panel.Idled    += OnPanelIdled;
        }
Esempio n. 3
0
        /// <summary>
        /// Starts search in the background and opens the panel for results immediately.
        /// </summary>
        /// <param name="sourcePanel">The result panel to open.</param>
        public void InvokeAsync(Panel sourcePanel)
        {
            if (sourcePanel == null) throw new ArgumentNullException("sourcePanel");

            var panel = new SuperPanel();
            panel.Title = Res.Searching;

            // open panel (try)
            panel.OpenChild(sourcePanel);

            // start search
            (new Thread(InvokeAsyncWorker)).Start();

            // subscribe
            panel.Escaping += OnPanelEscaping;
            panel.Closed += OnPanelClosed;
            panel.Idled += OnPanelIdled;
        }
Esempio n. 4
0
        /// <summary>
        /// Starts search and when it is done opens the panel with results.
        /// </summary>
        /// <param name="sourcePanel">The result panel to open.</param>
        public void Invoke(Panel sourcePanel)
        {
            if (sourcePanel == null) throw new ArgumentNullException("sourcePanel");

            // panel with the file store
            var panel = new SuperPanel();

            // invoke
            IsCompleted = false;
            try
            {
                panel.Explorer.AddFiles(InvokeWithProgress());
            }
            finally
            {
                IsCompleted = true;
            }

            // complete panel
            panel.Escaping += OnPanelEscaping;
            panel.Title = string.Format(null, Res.SearchTitle,
                FoundFileCount, ProcessedDirectoryCount, Stopping ? Res.StateStopped : Res.StateCompleted);

            // open panel, even empty
            panel.OpenChild(sourcePanel);
        }