Stetic.Application.InternalIsWidgetLibrary C# (CSharp) Method

InternalIsWidgetLibrary() static private method

static private InternalIsWidgetLibrary ( AssemblyResolver resolver, string assemblyRef ) : bool
resolver AssemblyResolver
assemblyRef string
return bool
        internal static bool InternalIsWidgetLibrary(AssemblyResolver resolver, string assemblyRef)
        {
            string path;

            if (assemblyRef.EndsWith (".dll") || assemblyRef.EndsWith (".exe")) {
                if (!File.Exists (assemblyRef))
                    return false;
                path = assemblyRef;
            }
            else {
                path = resolver.Resolve (assemblyRef, null);
                if (path == null)
                    return false;
            }

            return CecilWidgetLibrary.IsWidgetLibrary (path);
        }

Usage Example

Example #1
0
        void RegisterLibrary(AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib)
        {
            if (lib == null || visited.Contains(lib.Name))
            {
                return;
            }

            visited [lib.Name] = lib;

            foreach (string s in lib.GetLibraryDependencies())
            {
                if (!Application.InternalIsWidgetLibrary(resolver, s))
                {
                    continue;
                }
                AddLibrary(resolver, visited, s);
            }

            try {
                Registry.RegisterWidgetLibrary(lib);
            } catch (Exception ex) {
                // Catch errors when loading a library to avoid aborting
                // the whole update method. After all, that's not a fatal
                // error (some widgets just won't be shown).
                // FIXME: return the error somewhere
                Console.WriteLine(ex);
            }
        }
All Usage Examples Of Stetic.Application::InternalIsWidgetLibrary