本文整理汇总了C#中Setting.LoadAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Setting.LoadAsync方法的具体用法?C# Setting.LoadAsync怎么用?C# Setting.LoadAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting.LoadAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStats
public async Task GetStats()
{
var storage = new Setting<List<FileUploadCompleted>>();
List<FileUploadCompleted> accountList = await storage.LoadAsync("Statistics");
ItemGridView.ItemsSource = accountList;
}
示例2: GetStats
public async void GetStats()
{
ItemGridView.ItemsSource = null;
// AutoUpload.patientList.Reverse();
ItemGridView.ItemsSource = AutoUpload.patientList;
int count = 0;
// ItemGridViewDownload.ItemsSource = AutoUpload.patientList;
if (AutoUpload.patientList.Count > 0)
{
double currentStatus = AutoUpload.patientList.Average(p => p.Image1.Status);
if(currentStatus <30)
progressbar.Foreground = new SolidColorBrush(Colors.Orange);
if(currentStatus >30 && currentStatus < 70)
progressbar.Foreground= new SolidColorBrush(Colors.LightBlue);
if (currentStatus > 70 && currentStatus < 90)
progressbar.Foreground= new SolidColorBrush(Colors.LightGreen);
if (currentStatus > 90 && currentStatus <= 100)
progressbar.Foreground = new SolidColorBrush(Colors.Green);
progressbar.Value = currentStatus;
uploadinfo.Text = " Total " + AutoUpload.patientList.Count.ToString() + " files. Completed " + progressbar.Value.ToString() + "%";
try
{
var storage = new Setting<int>();
count= await storage.LoadAsync("CurrentUploadCount");
uploadinfo.Text = " Total " + count.ToString() + " files. Completed " + progressbar.Value.ToString() + "%";
}
catch
{
}
//uploadinfo.Text = " Total " + AutoUpload.patientList.Count.ToString() + " files. Completed " + progressbar.Value.ToString() + "%";
uploadinfo.Text += "\r\n total Size: " + AutoUpload.patientList.Sum(p => p.Image1.Size).ToString() + " MB";
// uploadinfo.Text += "\r\n Start time: " + AutoUpload.patientList[0].Image1.UploadStartTime;
uploadinfo.Text += "\r\n Start time: " + AutoUpload.StartTime;
if (count > 0)
{
// uploadinfo.Text += "\r\n Endtime time: " + AutoUpload.patientList[AutoUpload.patientList.Count - 1].Image1.UploadEndtime;
uploadinfo.Text += "\r\n EndTime :" + AutoUpload.EndTime;
}
}
else
{
uploadinfo.Text = "Currently there is no files to get upload to Server.";
}
}
示例3: LogLocalStorage
public async Task LogLocalStorage(string path, string name)
{
//List<FileUploadCompleted> loglist = new List<FileUploadCompleted>();
//loglist.Add(new FileUploadCompleted { name = name, uploadedOn = DateTime.Now, url = path });
//var applicationData = Windows.Storage.ApplicationData.Current;
//var localSettings = applicationData.LocalSettings;
//if(localSettings.Values["uploadlog"] !=null)
//{
// List<FileUploadCompleted> localloglist = (List<FileUploadCompleted>)localSettings.Values["uploadlog"];
//}
//else
//{
// localSettings.Values["uploadlog"] = loglist;
//}
var storage = new Setting<List<FileUploadCompleted>>();
List<FileUploadCompleted> obj = await storage.LoadAsync("uploadlog");
List<FileUploadCompleted> loglist;
if(obj!=null)
{
if (obj.Where(p => p.Name != name).ToList().Count < 1)
{
loglist = obj;
loglist.Add(new FileUploadCompleted { Name = name, UploadEndtime = DateTime.Now, Url = path });
await storage.SaveAsync("uploadlog", loglist);
}
}
else
{
loglist = new List<FileUploadCompleted>();
await storage.SaveAsync("uploadlog", loglist);
}
}