static void Main(string[] args) { IndexerSample s = new IndexerSample(); Console.WriteLine(s[2]); Console.ReadLine(); }
private static void Week4FundamentalsReview() { //Fundamentals /* * example of calling a static class and its static method, noting * that we do not need to instantiate an instance of the class to use it */ Console.WriteLine(Utility.AddTwoNumbers(7, 6)); //the square has access to the abstract class Shape's properties (ie: square.Sides) Square square = new Square(5, 5); square.Sides = 100; Console.WriteLine(square.Area()); //Generics example Dinosaur dino1G = new Dinosaur(); Dinosaur dino2G = new Dinosaur(); Dinosaur dino3G = new Dinosaur(); TRex tRexG = new TRex(); GenericsList <Dinosaur> dinoList = new GenericsList <Dinosaur>(); dinoList.Add(dino1G); dinoList.Add(dino2G); dinoList.Add(dino3G); dinoList.Add(tRexG); //Indexers IndexerSample indexSample = new IndexerSample(); for (int i = 0; i < indexSample.Length; i++) { Console.WriteLine(indexSample[i]); } }
public void TestIndexerPropertiesAreNotDeserialized() { object obj = IndexerSample.GetSampleInstance(); PerformTest(obj); }