private void CreatePermutaionList(string[] pStratvarList)
        {
            int i = 0;

            Frequency.SelectClauses = new List <string>();

            if (pStratvarList != null)
            {
                List <DataRow> Rows = this.Context.GetDataRows(null);

                foreach (string StratVar in pStratvarList)
                {
                    Frequency.PermutationList.Add(StratVar, new List <object>());
                }

                foreach (DataRow R in Rows)
                {
                    foreach (string StratVar in pStratvarList)
                    {
                        bool isFound = false;
                        for (i = 0; i < Frequency.PermutationList[StratVar].Count; i++)
                        {
                            if (CompareEqual(Frequency.PermutationList[StratVar][i], R[StratVar]))
                            {
                                isFound = true;
                                break;
                            }
                        }

                        if (!isFound)
                        {
                            Frequency.PermutationList[StratVar].Add(R[StratVar]);
                        }
                    }
                }

                EnumerablePermuter_Freq EP = new EnumerablePermuter_Freq(this.Context.Columns, EnumerablePermuter_Freq.RunModeEnum.SelectClauses, ref this.StratvarList, ref Frequency.SelectClauses);

                System.Collections.IEnumerable[] PL = new System.Collections.IEnumerable[Frequency.PermutationList.Count];
                i = 0;
                foreach (KeyValuePair <string, List <object> > Key in Frequency.PermutationList)
                {
                    PL[i++] = Key.Value;
                }

                EP.VisitAll(PL);
            }

            if (Frequency.SelectClauses.Count == 0)
            {
                Frequency.SelectClauses.Add("");
            }
        }
Beispiel #2
0
        private void CreatePermutaionList(string[] pStratvarList)
        {
            int i = 0;
            Frequency.SelectClauses = new List<string>();

            if (pStratvarList != null)
            {
                List<DataRow> Rows = this.Context.GetDataRows(null);

                foreach (string StratVar in pStratvarList)
                {
                    Frequency.PermutationList.Add(StratVar, new List<object>());
                }

                foreach (DataRow R in Rows)
                {
                    foreach (string StratVar in pStratvarList)
                    {
                        bool isFound = false;
                        for (i = 0; i < Frequency.PermutationList[StratVar].Count; i++)
                        {
                            if (CompareEqual(Frequency.PermutationList[StratVar][i], R[StratVar]))
                            {
                                isFound = true;
                                break;
                            }
                        }

                        if (!isFound)
                        {
                            Frequency.PermutationList[StratVar].Add(R[StratVar]);
                        }
                    }
                }

                EnumerablePermuter_Freq EP = new EnumerablePermuter_Freq(this.Context.Columns, EnumerablePermuter_Freq.RunModeEnum.SelectClauses, ref this.StratvarList, ref Frequency.SelectClauses);

                System.Collections.IEnumerable[] PL = new System.Collections.IEnumerable[Frequency.PermutationList.Count];
                i = 0;
                foreach (KeyValuePair<string, List<object>> Key in Frequency.PermutationList)
                {
                    PL[i++] = Key.Value;
                }

                EP.VisitAll(PL);
            }

            if (Frequency.SelectClauses.Count == 0)
            {
                Frequency.SelectClauses.Add("");
            }
        }