Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / C# 4.0

Adventures with C# 4.0 dynamic - ExpandoObject, ElasticObject, and a Twitter client in 10 minutes

Rate me:
Please Sign up or sign in to vote.
4.89/5 (64 votes)
29 Mar 2010CPOL7 min read 209.7K   4.4K   144  
Explores the dynamic features in C# 4.0, and a few cool things you can do with the same.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AmazedSaint.Elastic.Lib
{
    public interface IHierarchyWrapperProvider<T>
    {
        IEnumerable<KeyValuePair<string, T>> Attributes { get;  }
        bool HasAttribute(string name);
        IEnumerable<T> Elements { get; }
        void SetAttributeValue(string name, object obj);
        object GetAttributeValue(string name);
        T Attribute(string name);
        T Element(string name);
        void AddAttribute(string key, T value);
        void RemoveAttribute(string key);
        void AddElement(T element);
        void RemoveElement(T element);
        object InternalValue { get; set; }
        object InternalContent { get; set; }
        string InternalName { get; set; }
        T InternalParent { get; set; }
        
    }

    public interface IElasticHierarchyWrapper : IHierarchyWrapperProvider<ElasticObject> { }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#

Comments and Discussions