Пример #1
0
        /// <summary>
        /// Opens the specified file for reading.
        /// </summary>
        /// <param name="filename">The specified file's name.</param>
        private void OpenFile(string filename)
        {
            object[] LoadedInfo = null;

            try
            {
                Filename = filename;

                using (var source = File.OpenRead(filename))
                {
                    //if (OperationMode == 0)
                    LoadedInfo = ObjectInfoFormatter.Read(source);
                    //if (OperationMode == 1) LoadedInfo = EffectInfoFormatter.Read(source);
                }
            }
            catch
            {
                Filename = null;
            }
            finally
            {
                UpdateResource(LoadedInfo);

                SelectionChanged();
            }
        }
Пример #2
0
 object DeserializeObjectInfo(string name)
 {
     using (var source = File.OpenRead(@"res-dev\objectinfo\" + name))
         return(ObjectInfoFormatter.Read(source));
 }