Пример #1
0
        static void Main(string[] args)
        {
            dynamic bagA = new FastNBag(5);
            bagA.Foo = 1;
            bagA.FooFoo = 2;
            bagA.FooBar = 3;
            bagA.Bar = 4;
            bagA.BarFoo = 5;
            bagA.BarBar = 6;

            // Retrieves from fast array:
            Console.WriteLine(bagA.FooBar);

            // Retrieves from hashtable:
            Console.WriteLine(bagA.BarBar);

            // Binding fails - C#'s own runtime binder exception is thrown:
            try
            {
                Console.WriteLine(bagA.Baz);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            dynamic bagA = new FastNBag(5);

            bagA.Foo    = 1;
            bagA.FooFoo = 2;
            bagA.FooBar = 3;
            bagA.Bar    = 4;
            bagA.BarFoo = 5;
            bagA.BarBar = 6;

            // Retrieves from fast array:
            Console.WriteLine(bagA.FooBar);

            // Retrieves from hashtable:
            Console.WriteLine(bagA.BarBar);

            // Binding fails - C#'s own runtime binder exception is thrown:
            try
            {
                Console.WriteLine(bagA.Baz);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Пример #3
0
 public MetaFastNBag(Expression expression, FastNBag value)
     : base(expression, BindingRestrictions.Empty, value) { }
Пример #4
0
 public MetaFastNBag(Expression expression, FastNBag value)
     : base(expression, BindingRestrictions.Empty, value)
 {
 }