// Currently only accepts packages and projects that compile into a static library
        public override bool CanDropNode(object dataObject, DragOperation operation)
        {
            if (dataObject is Package)
            {
                return(true);
            }

            if (dataObject is CProject)
            {
                CProject project = (CProject)dataObject;

                if (((ProjectPackageCollection)CurrentNode.DataItem).Project.Equals(project))
                {
                    return(false);
                }

                CProjectConfiguration config = (CProjectConfiguration)project.GetConfiguration(IdeApp.Workspace.ActiveConfiguration);

                if (config.CompileTarget != CompileTarget.Exe)
                {
                    return(true);
                }
            }

            return(false);
        }
        /// <summary>
        /// Finds a file in a project's include path(s)
        /// </summary>
        /// <param name="project">
        /// The project whose include path is to be searched
        /// <see cref="Project"/>
        /// </param>
        /// <param name="filename">
        /// A portion of a full file path
        /// <see cref="System.String"/>
        /// </param>
        /// <returns>
        /// The full found path, or filename if not found
        /// <see cref="System.String"/>
        /// </returns>
        private static string findFileInIncludes(Project project, string filename)
        {
            CProjectConfiguration conf = project.DefaultConfiguration as CProjectConfiguration;
            string fullpath            = string.Empty;

            if (!Path.IsPathRooted(filename))
            {
                // Check against base directory
                fullpath = findFileInPath(filename, project.BaseDirectory);
                if (string.Empty != fullpath)
                {
                    return(fullpath);
                }

                if (conf != null)
                {
                    // Check project's additional configuration includes
                    foreach (string p in conf.Includes)
                    {
                        fullpath = findFileInPath(filename, p);
                        if (string.Empty != fullpath)
                        {
                            return(fullpath);
                        }
                    }
                }
            }

            return(filename);
        }
예제 #3
0
        // FIXME: Currently only the compiler flags are sent, no linker flags are sent.
        public string GetCompilerFlags(Project project, string configuration)
        {
            if (!CanDeploy(project))
            {
                throw new Exception("Not a deployable project.");
            }

            CProjectConfiguration config = project.Configurations[configuration] as CProjectConfiguration;

            if (config == null)
            {
                return(string.Empty);
            }

            CProject cproj = project as CProject;

            return(cproj.Compiler.GetCompilerFlags(cproj, config));
        }