示例#1
0
 /// <summary>
 /// </summary>
 public void Dispose()
 {
     if (_id >= 0 && _dllLoader != null && _dllLoader.isValid() && _bingoLib != null && _indigo != null)
     {
         _indigo.setSessionID();
         Bingo.checkResult(_indigo, _bingoLib.bingoEndSearch(_id));
         _id = -1;
     }
 }
示例#2
0
        /// <summary>
        /// Creates a chemical storage of a specifed type in a specified location
        /// </summary>
        /// <param name="indigo">Indigo instance</param>
        /// <param name="location">Directory with the files location</param>
        /// <param name="type">"molecule" or "reaction"</param>
        /// <param name="options">Additional options separated with a semicolon. See the Bingo documentation for more details.</param>
        /// <returns>Bingo database instance</returns>
        public static Bingo createDatabaseFile(Indigo indigo, string location, string type, string options)
        {
            indigo.setSessionID();
            if (options == null)
            {
                options = "";
            }
            BingoLib lib        = Bingo.getLib(indigo);
            int      databaseID = Bingo.checkResult(indigo, lib.bingoCreateDatabaseFile(location, type, options));

            return(new Bingo(indigo, databaseID, lib));
        }
示例#3
0
 public String version()
 {
     _indigo.setSessionID();
     return(new String(_indigo.checkResult(_inchi_lib.indigoInchiVersion())));
 }
示例#4
0
 public void renderToFile(IndigoObject obj, string filename)
 {
     _indigo.setSessionID();
     _indigo.checkResult(_renderer_lib.indigoRenderToFile(obj.self, filename));
 }
示例#5
0
 /// <summary>
 /// Dispose method that closes the database
 /// </summary>
 public void Dispose()
 {
     if (_id >= 0 && _dllLoader != null && _dllLoader.isValid() && _indigo != null && _lib != null)
     {
         _indigo.setSessionID();
         Bingo.checkResult(_indigo, _lib.bingoCloseDatabase(_id));
         _id = -1;
     }
 }
示例#6
0
 public void Dispose()
 {
     if (dispatcher == null)
     {
         // This happens exclusively in 32-bit .NET environment
         // after an IndigoObject constructor throws an exception.
         // In fact, the object is not created in this case,
         // but for some reason the .NET VM disposes it, despite it
         // has not been initialized.
         return;
     }
     if (self >= 0)
     {
         // Check that the session is still alive
         // (.NET has no problem disposing referenced
         // objects before the objects that reference to them)
         if (dispatcher.getSID() >= 0)
         {
             dispatcher.setSessionID();
             dispatcher.free(self);
             self = -1;
         }
     }
 }
示例#7
0
文件: Bingo.cs 项目: equilion/indigo
 /// <summary>
 /// Loads a chemical storage of a specifed type from a specified location
 /// </summary>
 /// <param name="indigo">Indigo instance</param>
 /// <param name="location">Directory with the files location</param>
 /// <param name="options">Additional options separated with a semicolon. See the Bingo documentation for more details.</param>
 /// <returns>Bingo database instance</returns>
 public static Bingo loadDatabaseFile(Indigo indigo, string location, string options)
 {
     if (options == null)
     {
         options = "";
     }
     BingoLib lib = Bingo.getLib(indigo);
     indigo.setSessionID();
     int databaseID = Bingo.checkResult(indigo, lib.bingoLoadDatabaseFile(location, options));
     return new Bingo(indigo, databaseID, lib);
 }