Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 public override OperatorMethod Lift(CSharpOperators operators)
 {
     return(new LiftedBinaryOperatorMethod(operators, this));
 }
Ejemplo n.º 3
0
 public LambdaBinaryOperatorMethod(CSharpOperators operators, Func <T1, T2, T1> func)
     : this(operators, func, func)
 {
 }
Ejemplo n.º 4
0
 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]));
 }
Ejemplo n.º 5
0
 public virtual OperatorMethod Lift(CSharpOperators operators)
 {
     return(null);
 }