コード例 #1
0
ファイル: UwpCSV.cs プロジェクト: gastav3/SentracLogger
        public async void SaveFile()
        {
            try
            {
                DataTranslator translator = new DataTranslator();

                FileSavePicker savePicker = new FileSavePicker();
                savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
                savePicker.FileTypeChoices.Add("CSV", new List <string>()
                {
                    ".csv"
                });
                savePicker.SuggestedFileName = "Sentrac_Data";

                StorageFile file = await savePicker.PickSaveFileAsync();

                if (file != null)
                {
                    WriteToFile(file, translator.DataDotObjectsToDataTable(StaticValues.dotList));
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }