Beispiel #1
0
    // function to create map of the car passanger postion data
    public static Dictionary <string, List <customDataType> > createDictionary(Dictionary <string, List <customDataType> > positionDictionary, string key, string type, Int64 typeCount)
    {
        customDataType dataType = new customDataType();

        dataType.MyPropertyType      = type;
        dataType.MyPropertyTypeTotal = typeCount;
        //select only attributes related to the car seats
        if (!eligibleKey(key).Equals(""))
        {
            if (positionDictionary.ContainsKey(key))
            {
                if (positionDictionary[key] != null)
                {
                    positionDictionary[key].Add(dataType);
                }
                else
                {
                    positionDictionary[key] = new List <customDataType>();
                    positionDictionary[key].Add(dataType);
                }
            }
            else
            {
                List <customDataType> temp = new List <customDataType>();
                temp.Add(dataType);
                positionDictionary.Add(key, temp);
            }
        }

        return(positionDictionary);
    }
    // function to create map of the car passanger postion data
    public static Dictionary<string, List<customDataType>> createDictionary(Dictionary<string, List<customDataType>> positionDictionary, string key, string type, Int64 typeCount)
    {
        customDataType dataType = new customDataType();
        dataType.MyPropertyType = type;
        dataType.MyPropertyTypeTotal = typeCount;
        //select only attributes related to the car seats
        if (!eligibleKey(key).Equals(""))
        {
            if (positionDictionary.ContainsKey(key))
            {

                if (positionDictionary[key] != null)
                {
                    positionDictionary[key].Add(dataType);
                }
                else
                {
                    positionDictionary[key] = new List<customDataType>();
                    positionDictionary[key].Add(dataType);
                }
            }
            else
            {
                List<customDataType> temp = new List<customDataType>();
                temp.Add(dataType);
                positionDictionary.Add(key, temp);
            }
        }

        return positionDictionary;
    }