Exemple #1
0
        private async void ExportFont(object sender, RoutedEventArgs e)
        {
            FileSavePicker picker = new FileSavePicker()
            {
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
                SuggestedFileName      = this.FontName,
                DefaultFileExtension   = ".h"
            };

            picker.FileTypeChoices.Add("H", new List <string>()
            {
                ".h"
            });

            StorageFile file = await picker.PickSaveFileAsync();

            if (file != null)
            {
                this.CurrentFile.Items = this.Items.ToArray();
                CodeFactory codeFactory = new CodeFactory(this.CurrentFile);
                string      code        = await codeFactory.CreateSourceCode(this.FontName);

                await FileIO.WriteTextAsync(file, code);
            }
        }