Beispiel #1
0
        /// <summary>
        /// Устанавливает страницу фрейма окна.
        /// </summary>
        /// <param name="FramePage">Страница</param>
        internal void SetPage(ICustomPage FramePage)
        {
            if (SelectedFramePage != null)
            {
                SelectedFramePage.ClosePage();
            }

            _MainMenuWindow.Frame_Main.Content = FramePage;
            FramePage.OpenPage();

            SelectedFramePage = FramePage;
        }
        ///<summary>
        ///
        ///            Initializes workflow with specified data context
        ///            
        ///</summary>
        ///
        public bool Initialize(IDataContext context, IInitializationContext initializationContext)
        {
            solution = context.GetData<ISolution>(JetBrains.ReSharper.DataConstants.SOLUTION);

            psiLanguageType = context.GetData<PsiLanguageType>(DataConstants.PSI_LANGUAGE_TYPE);

            Assert.CheckNotNull(solution);

            bool emptyResult = false;

            UnusedReferencesSearchRequest request = new UnusedReferencesSearchRequest(solution);
            UnusedReferencesSearchDescriptor searchDescriptor = new UnusedReferencesSearchDescriptor(request);
            using(ReadLockCookie cookie = ReadLockCookie.Create())
            {
                searchDescriptor.Search();
            }

            emptyResult = request.EmptyResult;
            searchResults = request.Results;
            if (searchDescriptor.Items == null)
                return false;

            if (emptyResult)
            {
                EmptyResultsPane panel = new EmptyResultsPane();
                page = panel;
            }
            else
            {
                ModulesChooserPane pane = new ModulesChooserPane(this);
                pane.AutoActivate = true;
                page = pane;
            }

            return true;
        }