// // Return a 'friendly' string that identifies the build provider // internal static string GetDisplayName(BuildProvider buildProvider) { // If it has a VirtualPath, use it if (buildProvider.VirtualPath != null) { return(buildProvider.VirtualPath); } // Otherwise, the best we can do is the type name return(buildProvider.GetType().Name); }
bool IsCorrectBuilderType(BuildProvider bp) { if (bp == null) { return(false); } Type type; object[] attrs; type = bp.GetType(); attrs = type.GetCustomAttributes(true); if (attrs == null) { return(false); } BuildProviderAppliesToAttribute bpAppliesTo; bool attributeFound = false; foreach (object attr in attrs) { bpAppliesTo = attr as BuildProviderAppliesToAttribute; if (bpAppliesTo == null) { continue; } attributeFound = true; if ((bpAppliesTo.AppliesTo & BuildProviderAppliesTo.All) == BuildProviderAppliesTo.All || (bpAppliesTo.AppliesTo & BuildProviderAppliesTo.Code) == BuildProviderAppliesTo.Code) { return(true); } } if (attributeFound) { return(false); } return(true); }
// // Return a 'friendly' string that identifies the build provider // internal static string GetDisplayName(BuildProvider buildProvider) { // If it has a VirtualPath, use it if (buildProvider.VirtualPath != null) { return buildProvider.VirtualPath; } // Otherwise, the best we can do is the type name return buildProvider.GetType().Name; }