コード例 #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);
        }
コード例 #2
0
 public override OperatorMethod Lift(CSharpOperators operators)
 {
     return(new LiftedBinaryOperatorMethod(operators, this));
 }
コード例 #3
0
 public LambdaBinaryOperatorMethod(CSharpOperators operators, Func <T1, T2, T1> func)
     : this(operators, func, func)
 {
 }
コード例 #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]));
 }
コード例 #5
0
 public virtual OperatorMethod Lift(CSharpOperators operators)
 {
     return(null);
 }