Esempio n. 1
0
        public const int MTYOFILE = 6;  /* output 1!:2[2 */

        #endregion

        #region - Constructor -

        static JSession() // static constructor is always safe thread-wise
        {
            if (JSession.IsJeLoaded())
            {
                return;
            }
            if (null == (JSession.JeFullName = Environment.GetEnvironmentVariable("JEPATH")))
            {
                JSession.JeFullName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), JSession.JeName);
            }
            JSession.JeLibrary  = new UnmanagedLibrary(JSession.JeFullName);
            JSession.JInit      = JSession.JeLibrary.GetUnmanagedFunction <JInitType>("JInit");
            JSession.JSM        = JSession.JeLibrary.GetUnmanagedFunction <JSMType>("JSM");
            JSession.JDo        = JSession.JeLibrary.GetUnmanagedFunction <JDoType>("JDo");
            JSession.JGetLocale = JSession.JeLibrary.GetUnmanagedFunction <JGetLocaleType>("JGetLocale");
            JSession.Jga        = JSession.JeLibrary.GetUnmanagedFunction <JgaType>("Jga");
            JSession.JFree      = JSession.JeLibrary.GetUnmanagedFunction <JFreeType>("JFree");
        }
Esempio n. 2
0
 /// <summary>
 /// Release handle
 /// </summary>
 protected override bool ReleaseHandle()
 {
     return(0 == JSession.Free(handle));
 }
Esempio n. 3
0
 private static int Free(IntPtr jt)
 {
     return((null == JSession.JFree) ? 0 : JSession.JFree(jt));
 }
Esempio n. 4
0
        public string GetLocale()
        {
            IntPtr locale = JSession.JGetLocale(this._jt);

            return(Encoding.UTF8.GetString(this.BytesFromPtr(locale)));
        }
Esempio n. 5
0
 public int Do(string sentence)
 {
     this.LastSentence = sentence;
     return(null == sentence ? 0 : JSession.JDo(this._jt, Encoding.UTF8.GetBytes(sentence)));
 }
Esempio n. 6
0
 public void ApplyCallbacks()
 {
     JSession.JSM(this._jt, this._callbacks);
 }