public void CheckClassDependency(Schema.LoadedLibrary library, ClassDefinition classDefinition) { Schema.RegisteredClass classValue = Catalog.ClassLoader.GetClass(CatalogDeviceSession, classDefinition); if (!library.IsRequiredLibrary(classValue.Library)) { throw new Schema.SchemaException(Schema.SchemaException.Codes.NonRequiredClassDependency, classValue.Name, library.Name, classValue.Library.Name); // TODO: Better exception } }
public ServerFileInfo[] GetFileNames(string className, string environment) { Schema.RegisteredClass classValue = _serverProcess.ServerSession.Server.Catalog.ClassLoader.Classes[className]; List <string> libraryNames = new List <string>(); List <string> fileNames = new List <string>(); List <string> assemblyFileNames = new List <string>(); ArrayList fileDates = new ArrayList(); // Build the list of all files required to load the assemblies in all libraries required by the library for the given class Schema.Library library = _serverProcess.ServerSession.Server.Catalog.Libraries[classValue.Library.Name]; ServerFileInfos fileInfos = _session.Server.Server.GetFileNames(library, environment); // Return the results in reverse order to ensure that dependencies are loaded in the correct order ServerFileInfo[] results = new ServerFileInfo[fileInfos.Count]; for (int index = fileInfos.Count - 1; index >= 0; index--) { results[fileInfos.Count - index - 1] = fileInfos[index]; } return(results); }
public SettingsList UnregisterAssembly(LoadedLibrary library, Assembly assembly) { lock (_assemblies) { SettingsList classes = GetClassList(assembly); foreach (SettingsItem setting in classes.Values) { if (_classes.Contains(setting.Name)) { Schema.RegisteredClass classValue = _classes[setting.Name]; _classes.RemoveAt(_classes.IndexOf(setting.Name)); } } int index = _assemblies.IndexOf(assembly.FullName); if (index >= 0) { _assemblies.RemoveAt(index); } return(classes); } }