Наследование: VisualStudioProject
Пример #1
0
        public static ProjectBase CreatePlatformSpecificProject(Project coreVisualStudioProject, string fileName)
        {
            ProjectBase toReturn = null;

            if (FileManager.GetExtension(fileName) == "contentproj")
            {
                toReturn = new XnaContentProject(coreVisualStudioProject);
            }

            string errorMessage = null;

            if (toReturn == null)
            {
                toReturn = TryGetProjectTypeFromDefineConstants(coreVisualStudioProject, out errorMessage);
            }


            if (toReturn == null)
            {
                // If we got here that means that the preprocessor defines don't match what
                // Glue expects.  This is probably bad - Glue generated code will likely not
                // compile, so let's warn the user
                EditorObjects.IoC.Container.Get <IGlueCommands>().DialogCommands.ShowMessageBox(errorMessage);
            }

            return(toReturn);
        }
Пример #2
0
        public static ProjectBase CreatePlatformSpecificProject(Project coreVisualStudioProject, string fileName)
        {
            ProjectBase toReturn = null;
            if (FileManager.GetExtension(fileName) == "contentproj")
            {
                toReturn = new XnaContentProject(coreVisualStudioProject);
            }


            if (toReturn == null)
            {
                toReturn = TryGetProjectTypeFromDefineConstants(coreVisualStudioProject);
            }


            if (toReturn == null)
            {
                // If we got here that means that the preprocessor defines don't match what
                // Glue expects.  This is probably bad - Glue generated code will likely not
                // compile, so let's warn the user
                string warning = "Could not determine project type based off of preprocessor defines.  Glue will try to load the project, but you may have compilation errors";
                GlueGui.ShowMessageBox(warning);


                #region Backup Method for detecting project type off of FlatRedBall

                foreach (ProjectItem buildItem in coreVisualStudioProject.AllEvaluatedItems.Where(buildItem => buildItem.EvaluatedInclude.Contains("FlatRedBall")))
                {
                    if (buildItem.EvaluatedInclude.Contains("Mdx"))
                    {
                        toReturn = new MdxProject(coreVisualStudioProject);
                        break;
                    }

                    if (buildItem.EvaluatedInclude.Contains("FlatRedBall"))
                    {
                        if (buildItem.EvaluatedInclude.Contains("x86"))
                        {
                            toReturn = new XnaProject(coreVisualStudioProject);
                            break;
                        }
                        
                    }

                    break;
                }
                #endregion
            }

            if (toReturn == null)
            {

                foreach (ProjectItem buildItem in coreVisualStudioProject.AllEvaluatedItems.Where(buildItem => buildItem.EvaluatedInclude.Contains("Microsoft.Phone")))
                {
                    toReturn = new WindowsPhoneProject(coreVisualStudioProject);
                    break;
                }

            }


            return toReturn;
        }