예제 #1
0
        public static DictionaryBank Load(System.IO.TextReader textIn)
        {
            DictionaryBank result      = new DictionaryBank();
            string         countString = textIn.ReadLine();
            int            count       = int.Parse(countString);

            for (int i = 0; i < count; i++)
            {
                string   className = textIn.ReadLine();
                IAccount account   =
                    AccountFactory.MakeAccount(className, textIn);
                result.StoreAccount(account);
            }
            return(result);
        }
예제 #2
0
        public static DictionaryBank Load(string filename)
        {
            System.IO.TextReader textIn = null;
            DictionaryBank       result = null;

            try
            {
                textIn = new System.IO.StreamReader(filename);
                result = DictionaryBank.Load(textIn);
            }
            catch
            {
                return(null);
            }
            finally
            {
                if (textIn != null)
                {
                    textIn.Close();
                }
            }
            return(result);
        }