Beispiel #1
0
        /// <summary>
        /// Factory pattern to return null for invalid input.
        /// </summary>
        public static DatFile Create(FileInfo file, Pak pak)
        {
            try
            {
                if (!file.Exists)
                    return null;

                var instance = new DatFile(file, pak);

                return instance;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
                return null;
            }
        }
 public DatObject(Dictionary<string, string> elements, Pak pak, DatFile file)
 {
     Pak = pak;
     DatFile = file;
     _dictionary = elements.ToDictionary(x => (string)x.Key, x => (string)x.Value);
 }