troubleshooting Question

Trying to understand what this mean...types(lstTypes[i].AvailableDatatype)

Avatar of Stacie
StacieFlag for United States of America asked on
C#
2 Comments1 Solution119 ViewsLast Modified:
I'm having a hard time understanding this simple line of

 : types(lstTypes[i].AvailableDatatype);


using System;
using System.Collections.Generic;

namespace ConsoleApplicationTest
{
    class Program
    {
        static void Main(string[] args)
        {

            List<DotNet> lstTypes = new List<DotNet>();
            DotNet bltypes = new DotNet();
            bltypes.AvailableDatatype = "bool";
            lstTypes.Add(bltypes);


            DotNet strTypes = new DotNet();
            strTypes.AvailableDatatype = "string";
            lstTypes.Add(strTypes);

            DotNet intTypes = new DotNet();
            intTypes.AvailableDatatype = "int";
            lstTypes.Add(intTypes);

            DotNet decTypes = new DotNet();
            decTypes.AvailableDatatype = "decimal";
            lstTypes.Add(decTypes);


            types += x =>
            {
                Console.WriteLine(x);
                Console.ReadLine();
            };

            for (int i = 0; i <= lstTypes.Count - 1; i++)
            {
                types(lstTypes[i].AvailableDatatype);
            }




        }

        static event Action<string> types;



    }


    public class DotNet
    {
        public string AvailableDatatype { get; set; }
    }


}
ASKER CERTIFIED SOLUTION
Nitin Sontakke
Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros