コード例 #1
0
        //
        // 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);
        }
コード例 #2
0
ファイル: AppCodeCompiler.cs プロジェクト: pmq20/mono_forked
        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);
        }
コード例 #3
0
    //
    // 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;
    }