public void ReorganizationAvailability_DisabledWhenPreprocessorConditionalCompilationDirectivesExist()
        {
            UIThreadInvoker.Invoke(new Action(() =>
            {
                // Make sure the document is the active document for the environment.
                var document = TestOperations.GetActivatedDocument(_projectItem);
                Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument);

                // Confirm the code reorganization availability logic is in the expected state.
                Assert.IsFalse(_codeReorganizationAvailabilityLogic.CanReorganize(document));
            }));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called to update the current status of the command.
        /// </summary>
        protected override void OnBeforeQueryStatus()
        {
            Enabled = _codeReorganizationAvailabilityLogic.CanReorganize(Package.ActiveDocument);

            if (Enabled)
            {
                Text = "Reorgani&ze " + Package.ActiveDocument.Name;
            }
            else
            {
                Text = "Reorgani&ze Code";
            }
        }