Ejemplo n.º 1
0
        private async Task RunAsync(string expression)
        {
            try {
                REvaluationResult result = await EvaluateAsyncAsync(expression);

                if (result.ParseStatus == RParseStatus.OK && result.Error == null)
                {
                    OnSuccess(false);
                }
                else
                {
                    OnError(result.ToString());
                }
            } catch (Exception ex) {
                OnError(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private async Task SetEncodingComboBoxAsync()
        {
            try {
                REvaluationResult result = await CallIconvListAsync();

                if (result.ParseStatus == RParseStatus.OK && result.Error == null)
                {
                    var jarray = result.JsonResult as JArray;
                    if (jarray != null)
                    {
                        PopulateEncoding(jarray);
                    }
                }
                else
                {
                    OnError(result.ToString());
                }
            } catch (Exception ex) {
                OnError(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void CheckEvaluationResult(REvaluationResult result)
        {
            if (result.ParseStatus != RParseStatus.OK)
            {
                throw new RPackageManagerException(Resources.PackageManager_EvalParseError, new InvalidOperationException(result.ToString()));
            }

            if (result.Error != null)
            {
                throw new RPackageManagerException(string.Format(Resources.PackageManager_EvalError, result.Error), new InvalidOperationException(result.ToString()));
            }
        }