示例#1
0
        public static async Task <bool> SetCurrentThemeAceEditorTempContentAsync()
        {
            try
            {
                InfosModule module = await ModulesAccessManager.GetModuleViaIDAsync(await ModulesAccessManager.GetCurrentThemeMonacoID());

                StorageFile file_content = await ApplicationData.Current.LocalFolder.CreateFileAsync("themeace_temp.js", CreationCollisionOption.OpenIfExists);

                await FileIO.WriteTextAsync(file_content, await new ThemeReader(module.ID).GetThemeJSContentAsync());

                return(true);
            }
            catch
            {
                return(false);
            }
        }
示例#2
0
        public static async Task <bool> SetCurrentThemeTempContentAsync()
        {
            StorageFolder folder_module = await folder_modules.CreateFolderAsync(await ModulesAccessManager.GetCurrentThemeMonacoID() + "", CreationCollisionOption.OpenIfExists);

            StorageFile file_content_temp = await ApplicationData.Current.LocalFolder.CreateFileAsync("theme_temp.json", CreationCollisionOption.OpenIfExists), file_content = await folder_module.GetFileAsync("theme_ace.js");

            try
            {
                using (var reader = new StreamReader(await file_content.OpenStreamForReadAsync()))
                {
                    await FileIO.WriteTextAsync(file_content_temp, await reader.ReadToEndAsync());

                    return(true);
                }
            }
            catch
            {
                return(false);
            }
        }