コード例 #1
0
        private bool TryGetSerializedCommands()
        {
            try
            {
                var stream     = File.Open(_commandsPath, FileMode.Open);
                var bFormatter = new CustomFormatter();
                _commands = bFormatter.Deserialize(stream);
                stream.Close();
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
        private bool TryGetSerializedCommands()
        {
            try
            {
                var stream = File.Open(_commandsPath, FileMode.Open);
                var bFormatter = new CustomFormatter();
                _commands = bFormatter.Deserialize(stream);
                stream.Close();
            }
            catch (Exception)
            {
                return false;
            }

            return true;
        }
コード例 #3
0
 private void SerializeCommands()
 {
     var stream = File.Open(_commandsPath, FileMode.Create);
     var bFormatter = new CustomFormatter();
     bFormatter.Serialize(stream, _commands);
     stream.Close();
 }