Exemple #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);
            }
        }
        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);

            }
        }