Exemple #1
0
 public override bool CanExecute(IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
 {
     if (item is SolutionEntityItem)
     {
         SolutionEntityItem        entry = (SolutionEntityItem)item;
         SolutionItemConfiguration conf  = entry.GetConfiguration(configuration) as SolutionItemConfiguration;
         if (conf != null && conf.CustomCommands.HasCommands(CustomCommandType.Execute))
         {
             return(conf.CustomCommands.CanExecute(entry, CustomCommandType.Execute, context, configuration));
         }
         return(entry.OnGetCanExecute(context, configuration));
     }
     else if (item is WorkspaceItem)
     {
         return(((WorkspaceItem)item).OnGetCanExecute(context, configuration));
     }
     else if (item is SolutionItem)
     {
         return(((SolutionItem)item).OnGetCanExecute(context, configuration));
     }
     else
     {
         throw new InvalidOperationException("Unknown item type: " + item);
     }
 }