/// <summary> /// Gets the CSharpOperators instance for the specified <see cref="ICompilation"/>. /// This will make use of the context's cache manager (if available) to reuse the CSharpOperators instance. /// </summary> public static CSharpOperators Get(ICompilation compilation) { CacheManager cache = compilation.CacheManager; CSharpOperators operators = (CSharpOperators)cache.GetShared(typeof(CSharpOperators)); if (operators == null) { operators = (CSharpOperators)cache.GetOrAddShared(typeof(CSharpOperators), new CSharpOperators(compilation)); } return(operators); }
public override OperatorMethod Lift(CSharpOperators operators) { return(new LiftedBinaryOperatorMethod(operators, this)); }
public LambdaBinaryOperatorMethod(CSharpOperators operators, Func <T1, T2, T1> func) : this(operators, func, func) { }
public LiftedUnaryOperatorMethod(CSharpOperators operators, UnaryOperatorMethod baseMethod) : base(operators.compilation) { this.baseMethod = baseMethod; this.ReturnType = NullableType.Create(baseMethod.Compilation, baseMethod.ReturnType); this.Parameters.Add(operators.MakeNullableParameter(baseMethod.Parameters[0])); }
public virtual OperatorMethod Lift(CSharpOperators operators) { return(null); }