public void QueryStatus(vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     StatusOption = _client.IsRunning && Connect.IsSolutionOpened
                        ? vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
                        : vsCommandStatus.vsCommandStatusSupported;
     return;
 }
Esempio n. 2
0
 public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     base.QueryStatus(commandName, neededText, ref status, ref commandText);
     if (!m_addInSettings.ShowOpenModelButton)
     {
         status = status | vsCommandStatus.vsCommandStatusInvisible;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Queries the status.
 /// </summary>
 /// <param name="commandName">Name of the command.</param>
 /// <param name="neededText">The needed text.</param>
 /// <param name="status">The status.</param>
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status)
 {
     if (commandName == GetQualifiedCommandName(Command_Switch_Name) &&
         neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
     }
 }
 public void QueryStatus(vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     StatusOption = vsCommandStatus.vsCommandStatusInvisible | vsCommandStatus.vsCommandStatusUnsupported;
     //var config = Path.Combine(Path.Combine(Environment.GetFolderPath(_client.GetAppDataFolder()), "MightyMoose"), "AutoTest.config");
     //StatusOption = File.Exists(config) || Connect.IsSolutionOpened
     //                    ? vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
     //                    : vsCommandStatus.vsCommandStatusSupported;
 }
 public void QueryStatus(vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     StatusOption = vsCommandStatus.vsCommandStatusInvisible | vsCommandStatus.vsCommandStatusUnsupported;
     //var config = Path.Combine(Path.Combine(Environment.GetFolderPath(_client.GetAppDataFolder()), "MightyMoose"), "AutoTest.config");
     //StatusOption = File.Exists(config) || Connect.IsSolutionOpened
     //                    ? vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
     //                    : vsCommandStatus.vsCommandStatusSupported;
 }
Esempio n. 6
0
 public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     base.QueryStatus(commandName, neededText, ref status, ref commandText);
     if (!m_addInSettings.ShowSchemaExportButton || (!m_solutionManager.IsSchemaExportProjectAvailable && m_addInSettings.HideSchemaExportButtonIfProjectUnavailable))
     {
         status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusInvisible;
     }
 }
Esempio n. 7
0
 public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     base.QueryStatus(commandName, neededText, ref status, ref commandText);
     if (!m_addInSettings.ShowAboutButton)
     {
         status = status | vsCommandStatus.vsCommandStatusInvisible;
     }
 }
Esempio n. 8
0
 public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     base.QueryStatus(commandName, neededText, ref status, ref commandText);
     if (!m_addInSettings.ShowSchemaExportButton || (!m_solutionManager.IsSchemaExportProjectAvailable && m_addInSettings.HideSchemaExportButtonIfProjectUnavailable))
     {
         status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusInvisible;
     }
 }
Esempio n. 9
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term='commandName'>The name of the command to determine state for.</param>
        /// <param term='neededText'>Text that is needed for the command.</param>
        /// <param term='status'>The state of the command in the user interface.</param>
        /// <param term='commandText'>Text requested by the neededText parameter.</param>
        /// <seealso class='Exec' />
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
                if (commandName == StudioShellCommandName)
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                    return;
                }

                if (commandName == StudioShellRestartCommandName)
                {
                    if (null != Shell)
                    {
                        status = (vsCommandStatus)(vsCommandStatus.vsCommandStatusSupported |
                                                   vsCommandStatus.vsCommandStatusEnabled);
                    }
                    else
                    {
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
                    }
                    return;
                }
                if (commandName == StudioShellCancelCommandName)
                {
                    if (null != Shell && Shell.CurrentState == CommandExecutorState.Unavailable)
                    {
                        status = (vsCommandStatus)(vsCommandStatus.vsCommandStatusSupported |
                                                   vsCommandStatus.vsCommandStatusEnabled);
                    }
                    else
                    {
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
                    }
                    return;
                }

                if (commandName == StudioShellExecuteCommandName ||
                    FunctionUtilities.IsPowerShellCommandName(commandName))
                {
                    if (null != Shell && Shell.CurrentState == CommandExecutorState.Unavailable)
                    {
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
                    }
                    else
                    {
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported |
                                 vsCommandStatus.vsCommandStatusEnabled;
                    }
                    return;
                }

                if (commandName == StudioShellDoNothingCommandName)
                {
                    status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }
            }
        }
Esempio n. 10
0
 public void QueryStatus(vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     Logger.Write("client running = " + _client.IsRunning);
     Logger.Write("soution opened = " + Connect.IsSolutionOpened);
     StatusOption = _client.IsRunning && Connect.IsSolutionOpened
                        ? vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
                        : vsCommandStatus.vsCommandStatusSupported;
     return;
 }
        public void QueryStatus(string commandName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
        {
            var handler = GetHandler(commandName);

            if (handler != null)
            {
                handler.QueryStatus(NeededText, ref StatusOption, ref CommandText);
            }
        }
Esempio n. 12
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         status = SupportsCommand(commandName)
                                 ? (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
                                 : (vsCommandStatus)vsCommandStatus.vsCommandStatusUnsupported;
     }
 }
Esempio n. 13
0
        public bool ComandState(vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            commandText = Caption;

            if (IDE.ApplicationObject.ActiveDocument != null)
                commandText = Caption + " [" + IDE.ApplicationObject.ActiveDocument.Name + "]";

            return false;
        }
Esempio n. 14
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term='commandName'>The name of the command to determine state for.</param>
        /// <param term='neededText'>Text that is needed for the command.</param>
        /// <param term='status'>The state of the command in the user interface.</param>
        /// <param term='commandText'>Text requested by the neededText parameter.</param>
        /// <seealso class='Exec' />
        public virtual void QueryStatus(string CmdName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object CommandText)
        {
            Trace.WriteLine("QueryStatus " + CmdName + " " + neededText);

            if (RootMenu != null)
            {
                RootMenu.QueryStatus(CmdName, neededText, ref status, ref CommandText);
            }
        }
Esempio n. 15
0
 public void QueryStatus(vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     Logger.Write("client running = " + _client.IsRunning);
     Logger.Write("soution opened = " + Connect.IsSolutionOpened);
     StatusOption = _client.IsRunning && Connect.IsSolutionOpened
                        ? vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
                        : vsCommandStatus.vsCommandStatusSupported;
     return;
 }
Esempio n. 16
0
 /// <summary>
 /// Queries the command status.
 /// </summary>
 /// <param name="cmdName">Name of the CMD.</param>
 /// <param name="neededText">The needed text.</param>
 /// <param name="statusOption">The status option.</param>
 /// <param name="commandText">The command text.</param>
 public void QueryCommandStatus(string cmdName, vsCommandStatusTextWanted neededText, ref vsCommandStatus statusOption, ref object commandText)
 {
     if (cmdName == addIn.ProgID + "." + Command_SeeIL_CommandName)
     {
         // ReSharper disable BitwiseOperatorOnEnumWithoutFlags
         statusOption = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
         // ReSharper restore BitwiseOperatorOnEnumWithoutFlags
     }
 }
Esempio n. 17
0
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            VSMenuCommand vSMenuCommand = this[commandName];

            if (vSMenuCommand != null)
            {
                vSMenuCommand.OnQueryStatus(neededText, ref status, ref commandText);
            }
        }
Esempio n. 18
0
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "WTFCode.Connect.WTFCode")
         {
             status = (vsCommandStatus)3;
         }
     }
 }
Esempio n. 19
0
 public void QueryStatus( string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText )
 {
     if ( neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone )
     {
         if ( commandName == "SSMSAddin.Connect.SSMSAddin" )
         {
             status = ( vsCommandStatus )vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
         }
     }
 }
Esempio n. 20
0
        void IDTCommandTarget.QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus statusOption, ref object commandText)
        {
            vsCommandStatus statusOptionCopy = statusOption;
            object          commandTextCopy  = commandText;

            ShellProxy.Instance.InvokeHook(hooks => hooks.HandleQueryStatus(commandName, neededText, ref statusOptionCopy, ref commandTextCopy));

            statusOption = statusOptionCopy;
            commandText  = commandTextCopy;
        }
Esempio n. 21
0
        /*
         * QueryStatus
         */

        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term="commandName">The name of the command to determine state for.</param>
        /// <param term="neededText">Text that is needed for the command.</param>
        /// <param term="status">The state of the command in the user interface.</param>
        /// <param term="commandText">Text requested by the neededText parameter.</param>
        /// <seealso class="Exec" />
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
                if (commandName == _taskListIdentifier)
                {
                    status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }
            }
        }
Esempio n. 22
0
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (_addin_menu_commands_dictonary.ContainsKey(commandName))
         {
             _addin_menu_commands_dictonary[commandName].querystatus_handler(neededText, ref status, ref commandText);
         }
     }
 }
Esempio n. 23
0
 /// <summary>
 ///     Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's
 ///     availability is updated
 /// </summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "DamnTools.SqlTodoExplorer.Connect.OpenTodoExplorerGui")
         {
             status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
         }
     }
 }
Esempio n. 24
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "AnAppADay.JediVSIRC.Addin.Connect.JediVSIRC")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 25
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "ABB.SrcML.VisualStudio.PreviewAddIn.Connect.SrcMLPreviewAddin")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 26
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == _addInInstance.ProgID + "." + ConnectConstants.COMMAND_NAME_MENU_FILE || commandName == _addInInstance.ProgID + "." + ConnectConstants.COMMAND_NAME_MENU_TOOLS)
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 27
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "VSChangeTargetFrameworkExtension.Connect.VSChangeTargetFrameworkExtension")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 28
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term='commandName'>The name of the command to determine state for.</param>
        /// <param term='neededText'>Text that is needed for the command.</param>
        /// <param term='status'>The state of the command in the user interface.</param>
        /// <param term='commandText'>Text requested by the neededText parameter.</param>
        /// <seealso class='Exec' />
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            // TODO: route to the child menu item

            VSMenuCommand command = this[commandName];

            if (command != null)
            {
                command.OnQueryStatus(neededText, ref status, ref commandText);
            }
        }
Esempio n. 29
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "SSMSAddin.Connect.ViewReferencedValue")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 30
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(String commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref Object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName.ToLower() == "HuntingDog.Connect.HuntingDog".ToLower()) //DIY: if you're changing the name of your add-in you will need to change this
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 31
0
 public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (CmdName == "AutoTest.VSAddin.Connect.AutoTestVSAddin")
         {
             StatusOption = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 32
0
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus statusOption, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (_commands.ContainsKey(commandName))
         {
             statusOption = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "SPProjectServiceAddIn.Connect.SPProjectServiceAddIn")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 34
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     //var commands = new[] {"VSDesctops.Connect.Desk1"};
     //if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     //{
     //    if (commands.Contains(commandName))
     //    {
     status = (vsCommandStatus)3;
     //    }
     //}
 }
Esempio n. 35
0
 public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (CmdName == "Coding4Fun.CleanTamagotchi")
         {
             StatusOption = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 36
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == "RunTests.Connect.RunTests")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 37
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="CmdName"></param>
 /// <param name="NeededText"></param>
 /// <param name="StatusOption"></param>
 /// <param name="CommandText"></param>
 public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (CmdName.StartsWith("ControllerUpdater.Run"))
         {
             StatusOption = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 38
0
		public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
		{
			vsCommandStatus vsCommandStatu;
            if (CmdName == "dg.Sql.SchemaGeneratorAddIn.Connect.GenerateDalFromSelection")
            {
                if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
                {
                    vsCommandStatu = (SchemaGenerator.HasSelection(this._applicationObject) ? vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled : vsCommandStatus.vsCommandStatusSupported);
                    StatusOption = vsCommandStatu;
                }
            }
		}
Esempio n. 39
0
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText,
            ref vsCommandStatus status, ref object commandText)
        {
            if (neededText != vsCommandStatusTextWanted.vsCommandStatusTextWantedNone ||
                !_gitPlugin.CanHandleCommand(commandName))
                return;

            if (_gitPlugin.IsCommandEnabled(commandName))
                status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
            else
                status = vsCommandStatus.vsCommandStatusSupported;
        }
		/// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
		/// <param term='commandName'>The name of the command to determine state for.</param>
		/// <param term='neededText'>Text that is needed for the command.</param>
		/// <param term='status'>The state of the command in the user interface.</param>
		/// <param term='commandText'>Text requested by the neededText parameter.</param>
		/// <seealso class='Exec' />
		public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
		{			
			if (VS_AddIn.notNull())
				if(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
				{				
					if (VS_AddIn.showCommand(commandName))
					{
						status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported|vsCommandStatus.vsCommandStatusEnabled;
						return;
					}					
				}
		}
Esempio n. 41
0
 public virtual void QueryStatus(string cmdName
     , vsCommandStatusTextWanted neededText
     , ref vsCommandStatus statusOption
     , ref object commandText
 )
 {
     switch (neededText) {
     case vsCommandStatusTextWanted.vsCommandStatusTextWantedNone: {
         if (null != _application.Debugger && _application.Debugger.DebuggedProcesses.Count > 0) {
             statusOption = vsCommandStatus.vsCommandStatusSupported
                 | vsCommandStatus.vsCommandStatusEnabled;
         }
     } break;
     }
 }
Esempio n. 42
0
        public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            if (m_solutionManager.IsEnabled && m_addInSettings.ShowPropertyMapper && m_application.ActiveDocument != null &&
                (m_application.ActiveDocument.Name.Contains("DaoImpl") || !m_addInSettings.OnlyEnableCodeGenInDaoImpl)

                )
            {
                status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
                if (IsCommandAvailable(false))
                {
                    status = status | vsCommandStatus.vsCommandStatusEnabled;
                }
            }
            else
            {
                status = (vsCommandStatus)(vsCommandStatus.vsCommandStatusInvisible | vsCommandStatus.vsCommandStatusUnsupported);
            }
        }
Esempio n. 43
0
    void IDTCommandTarget.QueryStatus(string cmdName
        , vsCommandStatusTextWanted neededText
        , ref vsCommandStatus statusOption
        , ref object commandText
    )
    {
        statusOption = vsCommandStatus.vsCommandStatusUnsupported;

        ICommand command = null;
        _vsCommandTextToCommandMap.TryGetValue(cmdName, out command);

        if (null != command) {
            try {
                command.QueryStatus(cmdName, neededText, ref statusOption, ref commandText);
            } catch (Exception e) {
                var commandWindow = _application.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow).Object as CommandWindow;

                commandWindow.OutputString("QueryStatus on " + cmdName + " failed with exception: " + e.ToString());
            }
        }
    }
Esempio n. 44
0
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName == _addInInstance.ProgID + "." + COMMAND_NAME)
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 45
0
		/// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
		/// <param term='commandName'>The name of the command to determine state for.</param>
		/// <param term='neededText'>Text that is needed for the command.</param>
		/// <param term='status'>The state of the command in the user interface.</param>
		/// <param term='commandText'>Text requested by the neededText parameter.</param>
		/// <seealso class='Exec' />
		public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
		{
			if(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
			{
				if(commandName == "SaveSomeFiles.Connect.SaveSomeFiles")
				{
                    if (_applicationObject.Mode == vsIDEMode.vsIDEModeDebug)
                    {
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
                    }
                    else
                    {
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                    }
                    return;
				}
			}
		}
Esempio n. 46
0
 public bool ComandState(vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     return false;
 }
Esempio n. 47
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     SwitchAddin.Instance.QueryStatus(commandName, neededText, ref status);
 }
Esempio n. 48
0
      public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
      {
         try
         {
            Logger.LogMessage(CmdName);

            if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
               if (CmdName == "UTG.Connect.TestAddIn")
               {
                  StatusOption = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                  return;
               }
            }

            #region Notes:
            //VS uses this to determine what our addin should do as environment changes..open new files, solutions, docs and so on...

            //Set when button must be available...

            //Check for our command being quired...

            //Make is available when the code window is showing certain files
            #endregion

            //This section requires refactoring
            if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
               if(CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.PROJECT_SOLUTION_COMMAND_NAME)
               {
                  StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
               }
               else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.CODEWINDOW_TOKEN_COMMAND_NAME)
               {
                  if (_applicationObject != null && _applicationObject.ActiveWindow != null && _applicationObject.ActiveWindow.Document != null)
                  {
                     string currentFile = _applicationObject.ActiveWindow.Document.FullName.ToLower();

                     //Change this so that each supported language returns its extension so that we can add all extensions to a list where we simply would search if extension exists
                     if (currentFile.EndsWith(".cs") || currentFile.EndsWith(".vb"))
                     {
                        TextSelection sel = (TextSelection)_applicationObject.ActiveDocument.Selection;

                        //current scope
                        FileCodeModel2 fcm = (FileCodeModel2)_applicationObject.ActiveDocument.ProjectItem.FileCodeModel;

                        //Noticed that null happens on metadata files...
                        if (fcm == null)
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                        CodeElement ce = CodeExaminor.FindInnerMostCodeElement(fcm.CodeElements, sel.TopPoint);

                        if (ce != null && !sel.Text.Equals(string.Empty) && IsSupported(ce))
                           StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                        else
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                     else
                     {
                        StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                  }
               }
               else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.CODEWINDOW_TEST_METHOD_COMMAND_NAME)
               {
                  if (_applicationObject != null && _applicationObject.ActiveWindow != null && _applicationObject.ActiveWindow.Document != null)
                  {
                     string currentFile = _applicationObject.ActiveWindow.Document.FullName.ToLower();

                     //Change this so that each supported language returns its extension so that we can add all extensions to a list where we simply would search if extension exists
                     if (currentFile.EndsWith(".cs") || currentFile.EndsWith(".vb"))
                     {
                        TextSelection sel = (TextSelection)_applicationObject.ActiveDocument.Selection;

                        //current scope
                        FileCodeModel2 fcm = (FileCodeModel2)_applicationObject.ActiveDocument.ProjectItem.FileCodeModel;

                        //Noticed that null happens on metadata files...
                        if (fcm == null)
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                        CodeElement ce = CodeExaminor.FindInnerMostCodeElement(fcm.CodeElements, sel.TopPoint);

                        if (ce != null && !UTGManagerAndExaminor.ProjectExaminar.IsUnitTestProject(ce.ProjectItem.ContainingProject, this.testFramework.FrameworkTestAttributes))
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                        if (ce != null && !sel.Text.Equals(string.Empty) && ce is CodeFunction)
                           StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                        else
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                     else
                     {
                        StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                  }
               }
               else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.CODEWINDOW_TEST_CLASS_COMMAND_NAME ||
                        CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.CODEWINDOW_PARTCOVER_COMMAND_NAME)
               {
                  if (_applicationObject != null && _applicationObject.ActiveWindow != null && _applicationObject.ActiveWindow.Document != null)
                  {
                     string currentFile = _applicationObject.ActiveWindow.Document.FullName.ToLower();

                     //Change this so that each supported language returns its extension so that we can add all extensions to a list where we simply would search if extension exists
                     if (currentFile.EndsWith(".cs") || currentFile.EndsWith(".vb"))
                     {
                        TextSelection sel = (TextSelection)_applicationObject.ActiveDocument.Selection;

                        //current scope
                        FileCodeModel2 fcm = (FileCodeModel2)_applicationObject.ActiveDocument.ProjectItem.FileCodeModel;

                        //Noticed that null happens on metadata files...
                        if (fcm == null)
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                        CodeElement ce = CodeExaminor.FindInnerMostCodeElement(fcm.CodeElements, sel.TopPoint);

                        if (ce != null && !UTGManagerAndExaminor.ProjectExaminar.IsUnitTestProject(ce.ProjectItem.ContainingProject, this.testFramework.FrameworkTestAttributes))
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                        if (ce != null && !sel.Text.Equals(string.Empty) && ce is CodeClass)
                           StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                        else
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                     else
                     {
                        StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                  }
               }
               else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.CODEWINDOW_ATTACH_COMMAND_NAME)
               {
                  if (_applicationObject != null && _applicationObject.ActiveWindow != null && _applicationObject.ActiveWindow.Document != null)
                  {
                     string currentFile = _applicationObject.ActiveWindow.Document.FullName.ToLower();

                     //Change this so that each supported language returns its extension so that we can add all extensions to a list where we simply would search if extension exists
                     if (currentFile.EndsWith(".cs") || currentFile.EndsWith(".vb"))
                     {
                        //current scope
                        FileCodeModel2 fcm = (FileCodeModel2)_applicationObject.ActiveDocument.ProjectItem.FileCodeModel;

                        //Noticed that null happens on metadata files...
                        if (fcm == null)
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                        TextSelection sel = (TextSelection)_applicationObject.ActiveDocument.Selection;

                        CodeElement ce = CodeExaminor.FindInnerMostCodeElement(fcm.CodeElements, sel.TopPoint);

                        if (ce != null && !UTGManagerAndExaminor.ProjectExaminar.IsUnitTestProject(ce.ProjectItem.ContainingProject, this.testFramework.FrameworkTestAttributes))
                        {
                           StatusOption = vsCommandStatus.vsCommandStatusSupported;
                           return;
                        }

                       
                        StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                        
                     }
                     else
                     {
                        StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                  }
               }
               else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.CODEWINDOW_PROJECT_COMMAND_NAME)
               {
                  if (_applicationObject != null && _applicationObject.ActiveWindow != null && _applicationObject.ActiveWindow.Document != null)
                  {
                     //Here we are doing this to try and disable this command if the file open is not a codefilemodel file
                     //like metedata files...
                     
                     FileCodeModel2 fcm = (FileCodeModel2)_applicationObject.ActiveDocument.ProjectItem.FileCodeModel;

                     if (fcm == null)
                     {
                        StatusOption = vsCommandStatus.vsCommandStatusSupported;
                        return;
                     }

                     string currentFile = _applicationObject.ActiveWindow.Document.FullName.ToLower();

                     //Change this so that each supported language returns its extension so that we can add all extensions to a list where we simply would search if extension exists
                     if (currentFile.EndsWith(".cs") || currentFile.EndsWith(".vb"))
                     {
                        StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                     }
                     else
                     {
                        StatusOption = vsCommandStatus.vsCommandStatusSupported;
                     }
                  }
               }
               else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.PROJECT_COMMAND_NAME ||
                     CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.PROJECT_PARTCOVER_COMMAND_NAME)
                  {
                     UIHierarchy hierarchy = _applicationObject.ToolWindows.SolutionExplorer;

                     if (hierarchy != null && hierarchy.SelectedItems != null)
                     {
                        Object[] hierarchySelectedItems = (Object[])hierarchy.SelectedItems;

                        foreach (UIHierarchyItem hirarchySelectedItem in hierarchySelectedItems)
                        {
                           if (hirarchySelectedItem.Object is Project)
                           {
                              if (CanRunUnitTestProjectCommand((Project)hirarchySelectedItem.Object))
                              {
                                 StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                              }
                              else
                              {
                                 StatusOption = vsCommandStatus.vsCommandStatusSupported;
                              }
                           }
                        }
                     }
                  }
                  else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.PROJECT_COMMAND_ERROR_CLEAR_NAME)
                  {

                     UIHierarchy hierarchy = _applicationObject.ToolWindows.SolutionExplorer;

                     if (hierarchy != null && hierarchy.SelectedItems != null)
                     {
                        Object[] hierarchySelectedItems = (Object[])hierarchy.SelectedItems;

                        foreach (UIHierarchyItem hirarchySelectedItem in hierarchySelectedItems)
                        {
                           if (hirarchySelectedItem.Object is Project)
                           {
                              ErrorListProvider tvErrorListProvider = GetErrorListProvider();

                              if (tvErrorListProvider.Tasks.Count > 0)
                              {
                                 StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                              }
                              else
                              {
                                 StatusOption = vsCommandStatus.vsCommandStatusSupported;
                              }
                           }
                        }
                     }
                  }
                  else if (CmdName == _addInInstance.ProgID + "." + UTGHelper.CommonStrings.PROJECT_SYNC_REF_COMMAND_NAME)
                  {
                     UIHierarchy hierarchy = _applicationObject.ToolWindows.SolutionExplorer;

                     if (hierarchy != null && hierarchy.SelectedItems != null)
                     {
                        Object[] hierarchySelectedItems = (Object[])hierarchy.SelectedItems;

                        foreach (UIHierarchyItem hirarchySelectedItem in hierarchySelectedItems)
                        {
                           if (hirarchySelectedItem.Object is Project)
                           {
                              if (IsProjectReferencesSynced())
                              {
                                 StatusOption = vsCommandStatus.vsCommandStatusSupported;
                              }
                              else
                              {
                                 if (CanRunUnitTestProjectCommand((Project)hirarchySelectedItem.Object))
                                 {
                                    StatusOption = (vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported);
                                 }
                                 else
                                 {
                                    StatusOption = vsCommandStatus.vsCommandStatusSupported;
                                 }
                              }
                           }
                        }
                     }
                  }
            }
         }
         catch (Exception ex)
         {
            Logger.LogException(ex);

            ErrorHandler.HandleException(ex);
         }
      }
Esempio n. 49
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if(commandName == "NewGuid.Connect.NewGuid")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported|vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }
Esempio n. 50
0
 public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     if (CmdName == null) {
         throw new ArgumentNullException("CmdName");
     }
     if (NeededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone) {
         if (this.availableRefactorOptions.ContainsKey(CmdName)) {
             this.availableRefactorOptions[CmdName].QueryStatus(CmdName, NeededText, ref StatusOption, ref CommandText, applicationObject);
         }
     }
 }
Esempio n. 51
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param name='commandName'>The name of the command to determine state for.</param>
        /// <param name='neededText'>Text that is needed for the command.</param>
        /// <param name='status'>The state of the command in the user interface.</param>
        /// <param name='commandText'>Text requested by the neededText parameter.</param>
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone) {
                if (commandName == COMMANDNAMESPACE + "." + POPUP_MENU_NAME_MINIFIER) {
                    status = vsCommandStatus.vsCommandStatusInvisible;
                    ProjectItem projectItem = this.App.SelectedItems.Item(1).ProjectItem;
                    if (EngineManager.IsHandledWithoutHint(projectItem.FileName())) {
                        status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                    } else {

                        string path = projectItem.FileName();
                        if (this.IsLessFile(path) || this.IsCoffeeScriptFile(path) || this.IsCssFile(path) || this.IsJsFile(path)) {
                            status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                        }
                    }
                }
            }
            if (commandName == COMMANDNAMESPACE + "." + POPUP_MENU_NAME_JSHINT) {
                status = vsCommandStatus.vsCommandStatusInvisible;
                ProjectItem projectItem = this.App.SelectedItems.Item(1).ProjectItem;
                string path = projectItem.FileName();
                if (this.IsJsFile(path)) {
                    status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }
            }
            if (commandName == COMMANDNAMESPACE + "." + POPUP_MENU_NAME_CSSLINT) {
                status = vsCommandStatus.vsCommandStatusInvisible;
                ProjectItem projectItem = this.App.SelectedItems.Item(1).ProjectItem;
                string path = projectItem.FileName();
                if (this.IsCssFile(path)) {
                    status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }
            }
        }
Esempio n. 52
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         status = vsCommandStatus.vsCommandStatusSupported;
         if (_applicationObject.ActiveDocument != null)
         {
             if (commandName == "Emmet4VsAddin.Connect.wrap_with_abbreviation")
             {
                 TextSelection selection = _applicationObject.ActiveDocument.Selection as TextSelection;
                 if (selection.Text != "")
                 {
                     status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                 }
             }
             else
             {
                 status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
             }
         }
     }
 }
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if (commandName.StartsWith(_addInInstance.ProgID + "."))
         {
             status = (vsCommandStatus)(vsCommandStatus.vsCommandStatusEnabled |
                vsCommandStatus.vsCommandStatusSupported);
         }
         else
         {
             status = vsCommandStatus.vsCommandStatusUnsupported;
         }
     }
 }
Esempio n. 54
0
 internal void HandleQueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus statusOption, ref object commandText)
 {
     if (QueryStatus != null)
         QueryStatus(commandName, neededText, ref statusOption, ref commandText);
 }
Esempio n. 55
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term='commandName'>The name of the command to determine state for.</param>
        /// <param term='neededText'>Text that is needed for the command.</param>
        /// <param term='status'>The state of the command in the user interface.</param>
        /// <param term='commandText'>Text requested by the neededText parameter.</param>
        /// <seealso class='Exec' />
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            if(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
                if(commandName == "DBMLUpdate.Connect.DBMLUpdate")
                {
                    if(_applicationObject.Solution.IsOpen)
                    {
                        if(_applicationObject.ActiveDocument != null && _applicationObject.ActiveDocument.FullName.EndsWith(".dbml", StringComparison.InvariantCultureIgnoreCase))
                            status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                        else
                            status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
                    }
                    else
                        status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;

                    return;
                }
            }
        }
Esempio n. 56
0
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status,
     ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         switch (commandName.Replace(Command.COMMAND_PREFIX, ""))
         {
             case Command.MENU_BAR_EXPORT_COMMAND_NAME:
                 if (_applicationObject.Solution.IsOpen && DependenciesAreLoaded())
                     status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                 else
                     status = vsCommandStatus.vsCommandStatusSupported;
                 return;
         }
     }
 }
Esempio n. 57
0
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone &&
         GitPlugin.CanHandleCommand(commandName))
     {
         if (GitPlugin.IsCommandEnabled(commandName))
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
         else
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported;
     }
 }
 public void QueryStatus(string commandName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
 {
     var handler = GetHandler(commandName);
     if (handler != null)
         handler.QueryStatus(NeededText, ref StatusOption, ref CommandText);
 }
Esempio n. 59
0
        /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
        /// <param term='commandName'>The name of the command to determine state for.</param>
        /// <param term='neededText'>Text that is needed for the command.</param>
        /// <param term='status'>The state of the command in the user interface.</param>
        /// <param term='commandText'>Text requested by the neededText parameter.</param>
        /// <seealso class='Exec' />
        public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
            {
                if (commandName == "Mfconsulting.Vsprj2make.Connect.CreateMake")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.GenMDFiles")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.GenDistUnit")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.PrjxToCsproj")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.RunOnMono")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.Options")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.ExploreCurrSln")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }

                if (commandName == "Mfconsulting.Vsprj2make.Connect.ExploreCurrDoc")
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }
            }
        }
Esempio n. 60
0
 /// <summary>Implements the QueryStatus method of the IDTCommandTarget interface. This is called when the command's availability is updated</summary>
 /// <param term='commandName'>The name of the command to determine state for.</param>
 /// <param term='neededText'>Text that is needed for the command.</param>
 /// <param term='status'>The state of the command in the user interface.</param>
 /// <param term='commandText'>Text requested by the neededText parameter.</param>
 /// <seealso class='Exec' />
 public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
 {
     if(neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
     {
         if(commandName == "VS2010TestResultPublisher.Connect.VS2010TestResultPublisher")
         {
             status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported|vsCommandStatus.vsCommandStatusEnabled;
             return;
         }
     }
 }