Question

I'm writing a little Console app to test some basic MS ProjectServer interop. I can connect to the server with no problems, and I was trying to refactor one of my for (int i = 0; i < projectDataSet.Project.Count; i++) loops for a foreach (var project in projectDataSet.Project) one.

When I do the for, the type of projectDataSet.Project is SvcProject.ProjectDataSet.ProjectDataTable. So, I do the following:

projectClient.ReadProject(projectDataSet.Project[i].PROJ_UID,
    SvcProject.DataStoreEnum.WorkingStore);

To get the Project object I need.

But when I do the foreach variation, the type of the object project is SvcProject.ProjectDataSet+ProjectRow. I don't know how to handle this. What does it means, exactly?

Was it helpful?

Solution

It means that type2 is nested in type1

class type1
{
   public class type2 { }
}

To demonstrate this:

foreach (var t in typeof (A).GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic))
    Console.WriteLine(t.FullName);

class A
{
    private class B
    {
    }

    protected class C
    {
    }

    internal class D
    {
    }

    public class E
    {

    }
}

Output:

YourAssembly.A+B
YourAssembly.A+C
YourAssembly.A+D
YourAssembly.A+E
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top