Beispiel #1
0
 public static void EnsureLibraryRegistered(Program program, Schema.LibraryReference libraryReference, bool withReconciliation)
 {
     Schema.LoadedLibrary loadedLibrary = program.CatalogDeviceSession.ResolveLoadedLibrary(libraryReference.Name, false);
     if (loadedLibrary == null)
     {
         Schema.LoadedLibrary currentLibrary = program.ServerProcess.ServerSession.CurrentLibrary;
         try
         {
             Schema.Library library = program.Catalog.Libraries[libraryReference.Name];
             if (!VersionNumber.Compatible(libraryReference.Version, library.Version))
             {
                 throw new Schema.SchemaException(Schema.SchemaException.Codes.LibraryVersionMismatch, libraryReference.Name, libraryReference.Version.ToString(), library.Version.ToString());
             }
             RegisterLibrary(program, library.Name, withReconciliation);
         }
         finally
         {
             program.ServerProcess.ServerSession.CurrentLibrary = currentLibrary;
         }
     }
     else
     {
         Schema.Library library = program.Catalog.Libraries[libraryReference.Name];
         if (!VersionNumber.Compatible(libraryReference.Version, library.Version))
         {
             throw new Schema.SchemaException(Schema.SchemaException.Codes.LibraryVersionMismatch, libraryReference.Name, libraryReference.Version.ToString(), library.Version.ToString());
         }
     }
 }
Beispiel #2
0
 public override object InternalExecute(Program program, object[] arguments)
 {
                 #if NILPROPOGATION
     if (arguments[0] == null)
     {
         return(null);
     }
                 #endif
     Schema.LibraryReference reference = (Schema.LibraryReference)arguments[0];
     return(reference.Version);
 }
Beispiel #3
0
 public override object InternalExecute(Program program, object[] arguments)
 {
                 #if NILPROPOGATION
     if (arguments[0] == null || arguments[1] == null)
     {
         return(null);
     }
                 #endif
     Schema.LibraryReference library = (Schema.LibraryReference)arguments[0];
     library.Version = (VersionNumber)arguments[1];
     return(library);
 }