Пример #1
0
        internal static ReadOnlyCollection <XzaarExpression> ReturnReadOnlyExpressions(BlockExpression provider, ref object collection)
        {
            XzaarExpression tObj = collection as XzaarExpression;

            if (tObj != null)
            {
                // otherwise make sure only one readonly collection ever gets exposed
                Interlocked.CompareExchange(
                    ref collection,
                    new ReadOnlyCollection <XzaarExpression>(new BlockExpressionList(provider, tObj)),
                    tObj
                    );
            }

            // and return what is not guaranteed to be a readonly collection
            return((ReadOnlyCollection <XzaarExpression>)collection);
        }
Пример #2
0
 internal BlockExpressionList(BlockExpression provider, Expression arg0)
 {
     _block = provider;
     _arg0  = arg0;
 }