Ejemplo n.º 1
0
 // 保存饼图数据列表
 public async void SaveToFile()
 {
     try
     {
         await StorageFileHelper.WriteAsync(data, FILE_PIE_NAME);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e.Message);
     }
 }
Ejemplo n.º 2
0
 // 读取饼图数据列表
 public async Task <bool> LoadFromFile()
 {
     try
     {
         data = await StorageFileHelper.ReadAsync <ObservableCollection <PieChartDataItem> >(FILE_PIE_NAME);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e.Message);
     }
     return(data != null);
 }
Ejemplo n.º 3
0
        // 添加一条日常记录
        public async void AddNew(Daily item)
        {
            await Getdata();

            _data.Add(item);
            if (_data != null)
            {
                await StorageFileHelper.WriteAsync(_data, "Daily.dat");
            }
            else
            {
                MessageDialog dialog = new MessageDialog("data is null!");
                await dialog.ShowAsync();
            }
        }
Ejemplo n.º 4
0
        // 读取日常列表
        public async Task <bool> LoadFromFile()
        {
            _data = await StorageFileHelper.ReadAsync <List <Daily> >("Daily.dat");

            return(_data != null);
        }
Ejemplo n.º 5
0
        // 读取事项列表
        public async Task <bool> LoadFromFile()
        {
            _data = await StorageFileHelper.ReadAsync <ObservableCollection <EventListViewItem> >("Event.dat");

            return(_data != null);
        }