Bari.Plugins.Csharp.VisualStudio.CsprojSections.SourceItemsSection.GetElementNameFor C# (CSharp) Метод

GetElementNameFor() защищенный Метод

Gets the element name for a given compilation item.

The default implementation always returns Compile

protected GetElementNameFor ( Project project, string file ) : string
project Project
file string File name from the source set
Результат string
        protected override string GetElementNameFor(Project project, string file)
        {
            var ext = Path.GetExtension(file).ToLowerInvariant();
            var relativePath = ToProjectRelativePath(project, file, ProjectSourceSetName);

            if (ext == ".xaml")
            {
                if (IsWPFApplicationDefinition(project, file))
                    return "ApplicationDefinition";
                else
                    return "Page";
            }
            else if (ext == ".settings")
            {
                return "None";
            }
            else if (relativePath.StartsWith("Service References" + Path.DirectorySeparatorChar, StringComparison.InvariantCultureIgnoreCase))
            {
                if (ext != ".cs")
                    return "None";
                else
                    return "Compile";
            }
            else
                return base.GetElementNameFor(project, file);
        }