Exemplo n.º 1
0
    public override byte[] GetPacketData() // 바이트형 패킷(송신용)
    {
        ResultSerializer serializer = new ResultSerializer();

        serializer.Serialize(m_data);
        return(serializer.GetSerializedData());
    }
Exemplo n.º 2
0
        private void Export()
        {
            var exportDialog = new SaveFileDialog
            {
                FileName   = DateTime.Now.ToString("yyyyMMddHHmm") + "_export",
                DefaultExt = ".json",
                Filter     = "Json documents (.json)|*.json"
            };

            var dialogResult = exportDialog.ShowDialog();

            if (dialogResult != true)
            {
                return;
            }

            var serializer = new ResultSerializer(new ResultConverter());
            var serialized = serializer.Serialize(_sessionService.LastResult);

            File.WriteAllText(exportDialog.FileName, serialized);
        }