Ejemplo n.º 1
0
 private void DisplayCausesOrEffects(string causeOrEffectWord,
                                     SortedDictionary <int, CauseEffectHeader> causeEffectHeaderCollection,
                                     SortedDictionary <int, CauseEffectHelper> causeEffectHelperCollection)
 {
     Console.WriteLine();
     Console.WriteLine("Count of {0}s is {1}", causeOrEffectWord, causeEffectHeaderCollection.Count);
     Console.WriteLine();
     foreach (int causeEffectHeaderIndex in causeEffectHeaderCollection.Keys)
     {
         CauseEffectHeader causeEffectHeader = causeEffectHeaderCollection[causeEffectHeaderIndex];
         CauseEffectHelper causeEffectHelper = causeEffectHelperCollection[causeEffectHeaderIndex];
         Console.WriteLine("    {0} = \"{1}\" = \"{2}\"",
                           causeEffectHeader.Number,
                           causeEffectHeader.Description,
                           causeEffectHelper.Description);
     }
 }
Ejemplo n.º 2
0
            } // CauseEffectHelper

            private void ReadCauseEffectData(string causeOrEffect,
                                             string headerFilename,
                                             string helperFilename,
                                             SortedDictionary <int, CauseEffectHeader> causeEffectHeaderCollection,
                                             SortedDictionary <int, CauseEffectHelper> causeEffectHelperCollection)
            {
                causeEffectHeaderCollection.Clear();
                if (!File.Exists(headerFilename))
                {
                    Console.WriteLine("TMS {0} File \"{1}\" does not exist", causeOrEffect, headerFilename);
                }
                else
                {
                    using (BinaryReader binaryReader = new BinaryReader(File.OpenRead(headerFilename)))
                    {
                        while (binaryReader.BaseStream.Position < binaryReader.BaseStream.Length)
                        {
                            CauseEffectHeader causeEffectHeader = new CauseEffectHeader(binaryReader);
                            causeEffectHeaderCollection.Add(causeEffectHeader.Number, causeEffectHeader);
                        }
                    }
                }
                causeEffectHelperCollection.Clear();
                if (!File.Exists(helperFilename))
                {
                    Console.WriteLine("TMS {0} File \"{1}\" does not exist", causeOrEffect, helperFilename);
                }
                else
                {
                    using (BinaryReader binaryReader = new BinaryReader(File.OpenRead(helperFilename)))
                    {
                        while (binaryReader.BaseStream.Position < binaryReader.BaseStream.Length)
                        {
                            CauseEffectHelper causeEffectHelper = new CauseEffectHelper(binaryReader);
                            causeEffectHelperCollection.Add(causeEffectHelper.Number, causeEffectHelper);
                        }
                    }
                }
            }