using System;
#if NETSTANDARD || NETCOREAPP
using FastReport.Code.CodeDom.Compiler;
using FastReport.Code.CSharp;
#else
using System.CodeDom.Compiler;
using Microsoft.CSharp;
#endif
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
namespace FastReport.Utils
{
///
/// Specifies the behaviour of compiler when exception is thrown.
///
public enum CompilerExceptionBehaviour
{
///
/// Default behaviour. Throw exception.
///
Default,
///
/// Show exception message and replace incorrect expression by Placeholder.
///
ShowExceptionMessage,
///
/// Replace expression with exception message. Don't show any messages.
///
ReplaceExpressionWithExceptionMessage,
///
/// Replace exception with Placeholder value. Don't show any messages.
///
ReplaceExpressionWithPlaceholder
}
///
/// Contains compiler settings.
///
public class CompilerSettings
{
#region Fields
private string placeholder;
private CompilerExceptionBehaviour exceptionBehaviour;
#endregion Fields
#region Properties
///
/// Gets or set the string that will be used for replacing incorrect expressions.
///
public string Placeholder
{
get { return placeholder; }
set { placeholder = value; }
}
///
/// Gets or sets the behaviour of compiler when exception is thrown.
///
public CompilerExceptionBehaviour ExceptionBehaviour
{
get { return exceptionBehaviour; }
set { exceptionBehaviour = value; }
}
#endregion Properties
#region Constructors
///
/// Initializes a new instance of the class.
///
public CompilerSettings()
{
placeholder = "";
exceptionBehaviour = CompilerExceptionBehaviour.Default;
}
#endregion Constructors
}
}