Exemplo n.º 1
0
        public static bool DoesSolutionItemHaveProjects(this Project solutionItem)
        {
            if (solutionItem == null || solutionItem.ProjectItems.Count == 0)
            {
                return(false);
            }

            bool hasValidProjects = false;

            foreach (ProjectItem projectItem in solutionItem.ProjectItems)
            {
                if (projectItem.Object is Project)
                {
                    Project       thisProject = projectItem.Object as Project;
                    VSProjectType vsProjType  = VSUtils.DetermineProjectType(thisProject.Kind);

                    switch (vsProjType)
                    {
                    case VSProjectType.VBProject:
                    case VSProjectType.VJSharpProject:
                    case VSProjectType.CPlusPlusProject:
                    case VSProjectType.CSharpProject:
                    case VSProjectType.FSharpProject:
                    case VSProjectType.SDECSharpProject:
                    case VSProjectType.SDEVBProject:
                        return(true);
                    }
                }
            }

            return(hasValidProjects);
        }
Exemplo n.º 2
0
        public static bool IsSolutionFolder(this ProjectItem solutionItem)
        {
            if (solutionItem == null)
            {
                return(false);
            }

            return((solutionItem.Object is Project) ? false :
                   VSUtils.DetermineProjectType(solutionItem.Kind) == VSProjectType.SolutionItems);
        }
Exemplo n.º 3
0
        public static bool IsSolutionFolder(this Project solutionItem)
        {
            if (solutionItem == null)
            {
                return(false);
            }

            return((solutionItem.Object == null &&
                    !VSUtils.IsValidSolutionProject(solutionItem.Kind)) ||
                   !(solutionItem.Object is Project));
        }
Exemplo n.º 4
0
        public static bool IsValidProject(this Project solutionItem)
        {
            if (solutionItem == null)
            {
                return(false);
            }

            if (VSUtils.IsValidSolutionProject(solutionItem.Kind))
            {
                return(true);
            }

            return((solutionItem.Object != null && solutionItem.Object is Project &&
                    VSUtils.IsValidSolutionProject((solutionItem.Object as Project).Kind)) ? true : false);
        }
Exemplo n.º 5
0
 public static VSProjectType GetProjectType(this Project project)
 {
     return(VSUtils.DetermineProjectType(project.Kind));
 }
Exemplo n.º 6
0
        void _commandEvents_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
        {
            CommandExecuteEventArg e = new CommandExecuteEventArg(Guid, ID, CustomIn, CustomOut, ref CancelDefault, VSUtils.GetCommandByGuidAndID(_applicationObject, Guid, ID));

            this.SendMessageToAllSubscribers(VSEvents.BeforeCommandExecute, e);
        }
Exemplo n.º 7
0
        void _commandEvents_AfterExecute(string Guid, int ID, object CustomIn, object CustomOut)
        {
            CommandExecuteEventArg e = new CommandExecuteEventArg(Guid, ID, CustomIn, CustomOut, VSUtils.GetCommandByGuidAndID(_applicationObject, Guid, ID));

            this.SendMessageToAllSubscribers(VSEvents.AfterCommandExecute, e);
        }