Ardahan Kisbet
Ardahan Kisbet

Reputation: 659

C# Dictionary doesn't see my List

I have a class in another class. And in inner class I declare struct Impl. In this struct there is IdxPointList which include generic Pair. And below I create Dictionary which has uint as key and above list as value but it doesn't accept that List. Where am I going wrong.

public class PointHash
            {
                struct Impl
                {
                    List<Pair<uint, Vector2D>> IdxPointList;
                    Dictionary<uint, IdxPointList> points;
                }
                Impl impl;
                public PointHash()
                {
                    impl = new Impl();
                }                    
    }

enter image description here

Upvotes: 0

Views: 95

Answers (2)

Ardahan Kisbet
Ardahan Kisbet

Reputation: 659

I have updated my way of using the IdXPointList type by defining it at top of the class as user-defined type.

using IdxPointList= System.Collections.Generic.List<_3D.Helpers.slicingHelper.Pair<uint, MIRIA.Utility.Vector2D>>;


public class PointHash
{
    struct Impl
    {
        Dictionary<uint, IdxPointList> points;
    }
    Impl impl;
    public PointHash()
    {
        impl = new Impl();
    }                    
}

Upvotes: 0

Eutherpy
Eutherpy

Reputation: 4581

The declaration of a dictionary requires a type, not a particular variable:

Dictionary<uint, List<Pair<uint, Vector2D>>> points;

Upvotes: 8

Related Questions