static void Main(string[] args) { // Creating a dynamic dictionary. dynamic person = new DynamicDictionary(); // Adding new dynamic properties. // The TrySetMember method is called. person.FirstName = "Ellen"; person.LastName = "Adams"; // Calling a method defined in the DynmaicDictionary class. // The Print method is called. person.Print(); Console.WriteLine( "Removing all the elements from the dictionary."); // Calling a method that is not defined in the DynamicDictionary class. // The TryInvokeMember method is called. person.Clear(); // Calling the Print method again. person.Print(); // The following statement throws an exception at run time. // There is no Sample method // in the dictionary or in the DynamicDictionary class. // person.Sample(); }