Stetic.ApplicationBackend.GetProjectLibraries C# (CSharp) Method

GetProjectLibraries() public method

public GetProjectLibraries ( ProjectBackend project ) : Stetic.WidgetLibrary[]
project ProjectBackend
return Stetic.WidgetLibrary[]
        public WidgetLibrary[] GetProjectLibraries(ProjectBackend project)
        {
            ArrayList projectLibs = new ArrayList ();
            if (project != null)
                projectLibs.AddRange (project.WidgetLibraries);

            ArrayList list = new ArrayList ();
            list.Add (Registry.CoreWidgetLibrary);
            foreach (WidgetLibrary alib in Registry.RegisteredWidgetLibraries) {
                if (project != null && !alib.SupportsGtkVersion (project.TargetGtkVersion))
                    continue;
                string aname = alib.Name;
                if (projectLibs.Contains (aname) || globalWidgetLibraries.Contains (aname))
                    list.Add (alib);
            }
            return (WidgetLibrary[]) list.ToArray (typeof(WidgetLibrary));
        }

Usage Example

Beispiel #1
0
        public ArrayList GetComponentTypes()
        {
            ArrayList list = new ArrayList();

            foreach (WidgetLibrary lib in app.GetProjectLibraries(this))
            {
                // Don't include in the list widgets which are internal (when the library is
                // not internal to the project), widgets not assigned to any category, and deprecated ones.
                bool isInternalLib = IsInternalLibrary(lib.Name);
                foreach (ClassDescriptor cd in lib.AllClasses)
                {
                    if (!cd.Deprecated && cd.Category.Length > 0 && (isInternalLib || !cd.IsInternal) && cd.SupportsGtkVersion(TargetGtkVersion))
                    {
                        list.Add(cd.Name);
                    }
                }
            }
            return(list);
        }