/// <summary>
        /// Call this only AFTER the build methods for both sdict's CP and TM have been called!
        /// </summary>
        public void BuildSortDictForModuleTables()
        {
            CValueTableModule valueTableModule_TM;
            CValueTableModule valueTableModule_MT;

            SysCollGen.List <CValueTableModule> listTableModules_UnkMod;
            SysCollGen.List <CValueTableModule> listTableModules_MT = null;
            SysCollGen.SortedDictionary <string, SysCollGen.List <CValueTableTable> > .KeyCollection keyColl_CP;
            SysCollGen.SortedDictionary <string, SysCollGen.List <CValueTableTable> > .KeyCollection keyColl_PC;
            bool boolUnknownModuleKey_HasBeenAddedToMT;

            //

            // Skip whole method if sdict MT already exists.
            if (null != this.m_runProperties.m_sdictModuleTables)
            {
                goto LABEL_RETURN_kdx67_LABEL;
            }
            else
            {
                this.m_runProperties.m_sdictModuleTables = new SysCollGen.SortedDictionary
                                                           <string, SysCollGen.List <CValueTableModule> >();
            }


            // First, a simple copy of data from sdict TM to sdict MT.

            foreach (SysCollGen.KeyValuePair <string, CValueTableModule> eachKvpTM
                     in this.m_runProperties.m_sdictTableModules
                     )
            {
                valueTableModule_TM = eachKvpTM.Value;
                valueTableModule_MT = new CValueTableModule
                                      (
                    valueTableModule_TM.GetTableName(),
                    valueTableModule_TM.GetTableName(),
                    valueTableModule_TM.GetModuleName()
                                      );

                if (!this.m_runProperties.m_sdictModuleTables.ContainsKey
                        (valueTableModule_MT.GetModuleNameLowercaseNoSpaces())
                    )
                {
                    // New key.
                    listTableModules_MT = new SysCollGen.List <CValueTableModule>();
                    listTableModules_MT.Add(valueTableModule_MT);

                    this.m_runProperties.m_sdictModuleTables.Add
                        (valueTableModule_MT.GetModuleNameLowercaseNoSpaces(),
                        listTableModules_MT
                        );
                }
                else                  // Key ALREADY exists.
                {
                    listTableModules_MT = this.m_runProperties.m_sdictModuleTables
                                          [valueTableModule_MT.GetModuleNameLowercaseNoSpaces()];
                    listTableModules_MT.Add(valueTableModule_MT);
                }
            }

            //________________________________________________
            //________________________________________________


            // Create the special "UnknownModule" key in sdict MT.

            // First, loop through CP for all C.
            // Second, loop through PC for all P.

            //__________ Loop CP

            boolUnknownModuleKey_HasBeenAddedToMT = false;

            keyColl_CP = this.m_runProperties.GetSDictOfChildParents().Keys;

            foreach (string eachKey_C in keyColl_CP)
            {
                if (!this.m_runProperties.GetSDictOfTableModules().ContainsKey(eachKey_C))
                {
                    // This child table name was NOT in the T-M data gathered from Dynamics AX6 (AX 2012) by X++.
                    // Thus put this child table into the pretend Unknown Module.

                    valueTableModule_MT = new CValueTableModule
                                          (
                        eachKey_C,                               // IComparable
                        eachKey_C,                               // TableName
                        CRunProperties.M_readonly_sUnknownModule // ModuleName
                                          );

                    try
                    {
                        if ((!boolUnknownModuleKey_HasBeenAddedToMT) &&
                            !this.m_runProperties.GetSDictOfModuleTables().ContainsKey
                                (CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces)
                            )
                        {
                            // This is the first missing table name yet encountered, so
                            // create the key etc in the sdict MT.

                            listTableModules_UnkMod = new SysCollGen.List <CValueTableModule>();
                            listTableModules_UnkMod.Add(valueTableModule_MT);

                            this.m_runProperties.GetSDictOfModuleTables().Add
                            (
                                CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces,
                                listTableModules_UnkMod
                            );

                            boolUnknownModuleKey_HasBeenAddedToMT = true;
                        }
                        else
                        {
                            // sdict MT already has the Unknown Module key, so
                            // simply add the current table name to the corresponding value list.

                            listTableModules_UnkMod = this.m_runProperties.GetSDictOfModuleTables()
                                                      [CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces];

                            listTableModules_UnkMod.Add(valueTableModule_MT);
                        }
                    }
                    catch (Exception ee)
                    {
                        Console.WriteLine("Error_1742sc5: {0}", ee);
                        throw ee;
                    }
                }
            }             // EOForeach eachKey_C


            //__________ Loop PC

            //boolUnknownModuleKey_HasBeenAddedToMT = false;

            keyColl_PC = this.m_runProperties.GetSDictOfParentChilds().Keys;

            foreach (string eachKey_P in keyColl_PC)
            {
                if (!this.m_runProperties.GetSDictOfTableModules().ContainsKey(eachKey_P))
                {
                    // This child table name was NOT in the T-M data gathered from Dynamics AX6 (AX 2012) by X++.
                    // Thus put this child table into the pretend Unknown Module.

                    valueTableModule_MT = new CValueTableModule
                                          (
                        eachKey_P,                               // IComparable
                        eachKey_P,                               // TableName
                        CRunProperties.M_readonly_sUnknownModule // ModuleName
                                          );

                    try
                    {
                        if ((!boolUnknownModuleKey_HasBeenAddedToMT) &&
                            !this.m_runProperties.GetSDictOfModuleTables().ContainsKey
                                (CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces)
                            )
                        {
                            // This is the first missing table name yet encountered, so
                            // create the key etc in the sdict MT.

                            listTableModules_UnkMod = new SysCollGen.List <CValueTableModule>();
                            listTableModules_UnkMod.Add(valueTableModule_MT);

                            this.m_runProperties.GetSDictOfModuleTables().Add
                            (
                                CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces,
                                listTableModules_UnkMod
                            );

                            boolUnknownModuleKey_HasBeenAddedToMT = true;
                        }
                        else
                        {
                            // sdict MT already has the Unknown Module key, so
                            // simply add the current table name to the corresponding value list.

                            listTableModules_UnkMod = this.m_runProperties.GetSDictOfModuleTables()
                                                      [CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces];

                            listTableModules_UnkMod.Add(valueTableModule_MT);
                        }
                    }
                    catch (Exception ee)
                    {
                        Console.WriteLine("Error_1742sc5: {0}", ee);
                        throw ee;
                    }
                }
            }             // EOForeach eachKey_P


            //________________________________________________
            //________________________________________________


            // Add the "UnknownModule" tables to T-M sdict.

            if (boolUnknownModuleKey_HasBeenAddedToMT)
            {
                listTableModules_UnkMod = this.m_runProperties.GetSDictOfModuleTables()
                                          [CRunProperties.M_readonly_sUnknownModule_LowercaseNoSpaces];

                foreach (CValueTableModule eachValue_MT_UnkMod_T in listTableModules_UnkMod)
                {
                    valueTableModule_TM = new CValueTableModule
                                          (
                        eachValue_MT_UnkMod_T.GetModuleName(),                         // IComparable
                        eachValue_MT_UnkMod_T.GetTableName(),
                        eachValue_MT_UnkMod_T.GetModuleName()
                                          );

                    if (this.m_runProperties.GetSDictOfTableModules()
                        .ContainsKey(eachValue_MT_UnkMod_T.GetTableNameLowercase())
                        )
                    {
                        //Console.WriteLine("??? Caution_1733qf7: Semi-Unexpected duplicate key from PC loop into TM for UnkMod , {0}",
                        //	eachValue_MT_UnkMod_T.GetTableNameLowercase());
                    }
                    else
                    {
                        this.m_runProperties.GetSDictOfTableModules()
                        .Add(eachValue_MT_UnkMod_T.GetTableNameLowercase(), valueTableModule_TM);
                    }
                }                 // EOForeach eachValue_MT_UnkMod_T
            }

            LABEL_RETURN_kdx67_LABEL :;

            if (null == this.m_runProperties.m_sdictModuleTables)
            {
                this.m_runProperties.m_sdictModuleTables = new SysCollGen.SortedDictionary
                                                           <string, SysCollGen.List <CValueTableModule> >();
            }
            return;
        }
        /// <summary>
        /// This build of sdict TM must be called BEFORE the build of sdict MT is called!
        /// And, the build of sdict CP must be called BEFORE the build of sdict MT is called!
        /// </summary>
        public void BuildSortDictForTableModules()
        {
            SysIo.FileStream   fileStream;
            SysIo.StreamReader streamReader;
            CValueTableModule  valueTableModule_TM;

            char[]   cDelims = { '\t' };
            string[] sSplits;
            string   sLine          = "Initialize";
            int      nLineReadCount = 0;

            //

            if (null != this.m_runProperties.m_sdictTableModules)
            {
                goto LABEL_RETURN_kds67_LABEL;
            }
            else
            {
                this.m_runProperties.m_sdictTableModules = new SysCollGen.SortedDictionary
                                                           <string, CValueTableModule>();
            }

            using
            (
                fileStream = new SysIo.FileStream
                             (
                    this.m_runProperties.GetPathToInputDelimFiles()
                    + this.m_runProperties.GetInputDelimFilesCommonPrefix()
                    + this.m_runProperties.GetDelimFileTableModules(),
                    SysIo.FileMode.Open,
                    SysIo.FileAccess.Read,
                    SysIo.FileShare.Read
                             )
            )
            {
                streamReader = new SysIo.StreamReader(fileStream);


                while (streamReader.Peek() >= 0)                  // Loop thru input records.
                {
                    try
                    {
                        nLineReadCount++;
                        sLine   = streamReader.ReadLine();
                        sSplits = sLine.Split(cDelims, StringSplitOptions.RemoveEmptyEntries);
                        if (2 > sSplits.Length)
                        {
                            continue;
                        }
                        if (sSplits[0].StartsWith("//"))
                        {
                            continue;
                        }
                        if (sSplits[0].Trim().Length == 0)
                        {
                            continue;
                        }

                        valueTableModule_TM = new CValueTableModule
                                              (
                            sSplits[1],                             // IComparable
                            sSplits[0],                             // TableName
                            sSplits[1]                              // ModuleName
                                              );


                        // T-M
                        this.m_runProperties.m_sdictTableModules.Add
                        (
                            valueTableModule_TM.GetKeyTableDelimModule(),
                            valueTableModule_TM
                        );
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error_cyb50: nLineReadCount={0}, sLine={1}", nLineReadCount, sLine);
                        throw e;
                    }
                }
            }

            LABEL_RETURN_kds67_LABEL :;

            if (null == this.m_runProperties.m_sdictTableModules)
            {
                this.m_runProperties.m_sdictTableModules = new SysCollGen.SortedDictionary
                                                           <string, CValueTableModule>();
            }
            return;
        }