Ejemplo n.º 1
0
        static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            CarSampleClass newCar = new CarSampleClass(SampleCarsEnumMaker.Citroen, SampleCarsEnumColor.Silver, 75);
            Type           type   = typeof(CarSampleClass);

            object[] allAttributes = type.GetCustomAttributes(false);

            foreach (VersionAttribute attr in allAttributes)
            {
                Console.WriteLine("Current version is: {0} ", attr.Version);
            }
        }
Ejemplo n.º 2
0
        static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            CarSampleClass newCar = new CarSampleClass(SampleCarsEnumMaker.Citroen, SampleCarsEnumColor.Silver, 75);
            Type type = typeof(CarSampleClass);
            object[] allAttributes = type.GetCustomAttributes(false);

            foreach (VersionAttribute attr in allAttributes)
            {
                Console.WriteLine("Current version is: {0} ", attr.Version);

            }
        }