/// <summary> /// Solves the specified expression asynchronously. /// <remarks>An event is raised on completion.</remarks> /// </summary> /// <param name="expression">The expression.</param> /// <exception cref="WolframException">Throws in case of any error.</exception> /// <exception cref="ArgumentNullException">Throws if the specified argument is null.</exception> /// <returns>The solution of the given expression</returns> public void SolveAsync(string expression) { if (string.IsNullOrEmpty(expression)) { throw new ArgumentNullException("expression", "Cannot evaluate a null string."); } var procedure = new ExpressionProcessorMethod(Solve); lock (SyncLock) { procedure.BeginInvoke(expression, HandleSolutionReceived, expression); } }
/// <summary> /// Solves the specified expression asynchronously. /// <remarks>An event is raised on completion.</remarks> /// </summary> /// <param name="expression">The expression.</param> /// <exception cref="WolframException">Throws in case of any error.</exception> /// <exception cref="ArgumentNullException">Throws if the specified argument is null.</exception> /// <returns>The solution of the given expression</returns> public void SolveAsync(string expression) { if(expression.IsNullOrEmpty()) throw new ArgumentNullException("expression", sLConsole.GetString("Cannot evaluate a null string.")); var procedure = new ExpressionProcessorMethod(Solve); lock(SyncLock) { procedure.BeginInvoke(expression, HandleSolutionReceived, expression); } }