当前位置: 首页>>代码示例>>C#>>正文


C# Setting.LoadAsync方法代码示例

本文整理汇总了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;
        }
开发者ID:prashanthganathe,项目名称:PersonalProjects,代码行数:7,代码来源:Stats.xaml.cs

示例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.";
            }
        }
开发者ID:prashanthganathe,项目名称:PersonalProjects,代码行数:49,代码来源:StatsNew.xaml.cs

示例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); 
            }

        }
开发者ID:prashanthganathe,项目名称:PersonalProjects,代码行数:37,代码来源:AmazonFileBucketTransferUtil.cs


注:本文中的Setting.LoadAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。