Format:
Recent snippets matching tags of Dynamic
public class Expando : DynamicObject { dynamic Instance; Dictionary<string, dynamic> ExtraProperties = new Dictionary<string, dynamic>(); public Expando(object instance) { Instance = instance; }
234 Views
no comments
//Static classes var con = typeof(System.Console).Extend(); con.WriteLine=new Action<string>(s=>System.Console.WriteLine("hello " + s)); con.WriteLine("hello world");
223 Views
no comments
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());
190 Views
no comments
// la la la if (foo is ISomeInterface) { ((ISomeInterface)foo).SomeMethod(); } else if (foo is ISomeOtherInterface) { ((ISomeOtherInterface)foo).SomeMethod(); } else { throw new SomeException();
336 Views
2 comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; namespace DynamicObjectContracts { public class Program
531 Views
no comments
dynamic _Dynamic = new ExpandoObject(); _Dynamic.Color = "Brown"; _Dynamic.Print = new Action(() => { Console.Write(_Dynamic.Color); }); _Dynamic.Print();
879 Views
no comments
using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.InteropServices; using System.Text;
334 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
