Ejemplo n.º 1
0
        //------------------------------------------ Assign Value for each key__________________
        private static void ParameterDefiner(List <string> ProccessedList)
        {
            List <string> TempObjectContainer    = new List <string> {
            };
            List <string> TempParameterContainer = new List <string> {
            };
            List <char> temp = new List <char> {
            };

            foreach (var item in ProccessedList)
            {
                if (item[2] == 60)  //Seperate Objects segments that starts with a <
                {
                    TempObjectContainer.Add(item);
                }
                else
                {
                    TempParameterContainer.Add(item);
                }
            }
            foreach (var item in TempParameterContainer)
            {
                temp = item.ToList();
                ParamDic[temp[0] + "" + temp[1]].Value = "";
                for (int i = 2; i < temp.Count; i++)
                {
                    //Assign The value in the stinrg to value in dictionary
                    ParamDic[temp[0] + "" + temp[1]].Value += temp[i];
                }
            }
            foreach (var item in TempObjectContainer)
            {
                List <string> TempList = new List <string>()
                {
                };
                //here we have AA<Gg345Gi834>

                //first send all inside <> to split

                TempList = StringSplitter(item.Substring(3, (item.Count() - 4)));
                foreach (var InnerItem in TempList)
                {
                    temp = InnerItem.ToList();
                    ParamObjectRelatedDic[temp[0] + "" + temp[1]].Value = "";
                    for (int i = 2; i < temp.Count; i++)
                    {
                        //Assign The value in the stinrg to value in dictionary
                        ParamObjectRelatedDic[temp[0] + "" + temp[1]].Value += temp[i];
                    }
                }
                var TempListForContainedParameter = new ObservableCollection <Parameter>()
                {
                };
                foreach (var ContainedParam in ParamObjectRelatedDic)
                {
                    if (ContainedParam.Value.Value != "")
                    {
                        TempListForContainedParameter.Add(ContainedParam.Value);
                    }
                }

                ObjectDic[item[0] + "" + item[1]].Value = "emptu";
                FinalListOfObjects.Add(ObjectDic[item[0] + "" + item[1]]);
            }
        }