static void Main(string[] args) { dynamic a = 1; dynamic b = 2; dynamic somma = a + b; a = "a"; Console.WriteLine(a + GetDynamicObject()); dynamic exo = new ExpandoObject(); exo.Name = "Antonio"; exo.Surname = "Pelleriti"; Console.WriteLine("{0} {1}", exo.Name, exo.Surname); IDictionary <string, object> dict = exo; foreach (var key in dict.Keys) { Console.WriteLine("{0}={1}", key, dict[key]); } dict.Remove("Surname"); dynamic dyn = new MyDynamicObject(); dyn.MetodoDinamico(); string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TextFile.txt"); dynamic df = new DynamicFile(path); List <string> lines = df.Lines; var obj = df.Prop; dynamic veicolo = new DynamicDictionary(); veicolo.Marca = "Alfa Romeo"; veicolo.Modello = "GT"; veicolo.Targa = "AB123CD"; Console.WriteLine("{0}", veicolo.Marca); veicolo.Print(); veicolo.Clear(); }
static void Main(string[] args) { dynamic a = 1; dynamic b = 2; dynamic somma = a + b; a = "a"; Console.WriteLine(a + GetDynamicObject()); dynamic exo = new ExpandoObject(); exo.Name = "Antonio"; exo.Surname = "Pelleriti"; Console.WriteLine("{0} {1}", exo.Name, exo.Surname); IDictionary<string, object> dict = exo; foreach(var key in dict.Keys) { Console.WriteLine("{0}={1}", key, dict[key]); } dict.Remove("Surname"); dynamic dyn = new MyDynamicObject(); dyn.MetodoDinamico(); string path=Path.Combine(Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location), "TextFile.txt"); dynamic df = new DynamicFile(path); List<string> lines= df.Lines; var obj = df.Prop; dynamic veicolo = new DynamicDictionary(); veicolo.Marca = "Alfa Romeo"; veicolo.Modello = "GT"; veicolo.Targa = "AB123CD"; Console.WriteLine("{0}", veicolo.Marca); veicolo.Print(); veicolo.Clear(); }