public QuickFileToolWindowControl(QuickFileToolWindow oQuickFileToolWindow)
        {
            this.InitializeComponent();

            mQuickFileToolWindow = oQuickFileToolWindow;

            mQuickFileToolWindow.Closing += OnClosing;

            //Common.Instance.SolutionWatcher.RefreshFileList();
            Common.Instance.SolutionWatcher.OnFilesChanged += OnFilesChanged;

            DataContext = this;

            textBox.Focus();

            listView.SelectedIndex = 0;

            RefreshList();
        }
Beispiel #2
0
        public QuickFileToolWindowControl(QuickFileToolWindow oQuickFileToolWindow, bool bHistoryOnly)
        {
            this.InitializeComponent();

            mQuickFileToolWindow = oQuickFileToolWindow;

            mQuickFileToolWindow.Closing += OnClosing;

            mHistoryOnly = bHistoryOnly;

            Common.Instance.SolutionWatcher.OnFilesChanged += OnFilesChanged;

            mDeferredRefresh = DeferredAction.Create(RefreshResults);

            DataContext = this;

            textBox.Focus();

            listView.SelectedIndex = 0;
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QuickHistoryCommand"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private QuickHistoryCommand(Package package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            this.package = package;

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (commandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new MenuCommand(this.ShowToolWindow, menuCommandID);
                commandService.AddCommand(menuItem);
            }

            window = new QuickFileToolWindow(true);
        }
        /// <summary>
        /// Shows the tool window when the menu item is clicked.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private void ShowToolWindow(object sender, EventArgs e)
        {
            // Get the instance number 0 of this tool window. This window is single instance so this instance
            // is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            /*ToolWindowPane window = this.package.FindToolWindow(typeof(QuickFileToolWindow), 0, true);
            if ((null == window) || (null == window.Frame))
            {
                throw new NotSupportedException("Cannot create tool window");
            }

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());*/

            //Common.Instance.SolutionWatcher.TestSpeed();

            QuickFileToolWindow window = new QuickFileToolWindow(false);
            window.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            window.ShowModal();
        }
 /// <summary>
 /// Shows the tool window when the menu item is clicked.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event args.</param>
 private void ShowToolWindow(object sender, EventArgs e)
 {
     QuickFileToolWindow window = new QuickFileToolWindow(true);
     window.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
     window.ShowModal();
 }