CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Expando
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Dynamic;
using System.Reflection;
using System.Collections;
 
namespace Westwind.Utilities.Dynamic
{
    /// <summary>
by Rick Strahl   January 31, 2012 @ 5:48pm
Tags: C#, Expando, MixIn
356 Views
2 comments
 
C#
public class Expando : DynamicObject
{
    dynamic Instance;
    Dictionary<string, dynamic> ExtraProperties = new Dictionary<string, dynamic>();
 
    public Expando(object instance)
    {
        Instance = instance;
    }
by Rick Strahl   November 16, 2011 @ 1:35pm
234 Views
no comments
 
C#
 
class PrototypeTest
{
    static void Main()
    {
        dynamic pastry1 = new Prototype();
        pastry1.PastryType = "cake";
        pastry1.Cake = new Func<string>(() => "awesome");
 
        Console.WriteLine("Pastry 1's {0} is {1}.", pastry1.PastryType, pastry1.Cake());
by Andy Sherwood   August 17, 2010 @ 9:22am
190 Views
no comments
 
C#
dynamic _Dynamic = new ExpandoObject();
_Dynamic.Color = "Brown";
_Dynamic.Print = new Action(() => { Console.Write(_Dynamic.Color); });
_Dynamic.Print();
by Jerry Nixon   March 05, 2010 @ 8:38am
879 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate