public bool Execute(string args, IntPtr sessionHandle) { IncreaseUse(); try { using (var session = new Native.ManagedSession(new Native.SWIGTYPE_p_switch_core_session(sessionHandle, false))) { session.Initialize(); session.SetAutoHangup(false); try { var plugin = createPlugin(); var context = new AppContext(args, session);; plugin.Run(context); return(true); } catch (Exception ex) { LogException("Run", Name, ex); return(false); } } } finally { DecreaseUse(); } }