public bool ValidateLibrary(Library lib, MFSolution solution, Processor proc, InventoryHelper helper)
        {
            try
            {
                if (!lib.IsSolutionWizardVisible)
                {
                    return false;
                }

                // don't show processor specific libraries
                if ((lib.ProcessorSpecific != null) && !string.IsNullOrEmpty(lib.ProcessorSpecific.Guid) &&
                    (0 != string.Compare(lib.ProcessorSpecific.Guid, solution.Processor.Guid, true)))
                {
                    return false;
                }

                if (!string.IsNullOrEmpty(lib.CustomFilter))
                {
                    bool OK = false;

                    // don't show custom specific libraries
                    foreach (string libFilter in lib.CustomFilter.Split(';'))
                    {
                        string[] customAttribs = proc.CustomFilter.Split(';');

                        foreach (string attrib in customAttribs)
                        {
                            if (string.Compare(attrib, libFilter, true) == 0)
                            {
                                OK = true;
                                break;
                            }
                        }
                        if (!OK)
                        {
                            foreach (string attrib in solution.CustomFilter.Split(';'))
                            {
                                if (0 == string.Compare(attrib, libFilter, true))
                                {
                                    OK = true;
                                    break;
                                }
                            }
                        }

                        /// 
                        /// Now lets check to see if one of the selected features contains this filter.
                        /// This is used for Network (LWIP) to enable the libraries to be auto selected
                        /// based on which Network feature was choosen
                        /// 
                        if (!OK)
                        {
                            MFProject defProj = null;
                            foreach(MFProject proj in solution.Projects)
                            {
                                if(proj.IsClrProject)
                                {
                                    defProj = proj; 
                                    break;
                                }
                            }

                            foreach (MFComponent feat in defProj.Features)
                            {
                                Feature f = helper.FindFeature(feat.Guid);
                                
                                if (f != null && 0 == string.Compare(f.Filter, libFilter, true))
                                {
                                    OK = true;
                                    break;
                                }
                            }
                        }

                        if (!OK)
                        {
                            OK = (0 == string.Compare(lib.CustomFilter, solution.Name, true));
                        }
                        if (OK) break;
                    }

                    if (!OK) return false;
                }

                if (!IsBootloaderProject() && lib.IsBootloaderLibrary())
                {
                    return false;
                }

                // only add CLR libraries to a CLR project
                if (lib.Level == LibraryLevel.CLR && !this.IsClrProject)
                {
                    return false;
                }

                string projPath = lib.ProjectPath.ToLower();
                if (projPath.Contains(@"\devicecode\drivers\sample\"))
                {
                    return false;
                }

                if (projPath.Contains("\\solutions\\") && !projPath.Contains("\\solutions\\" + solution.Name.ToLower() + "\\"))
                {
                    return false;
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception validating solution libraries: " + e.ToString());
                return false;
            }

            return true;
        }