本文介绍了隔离存储配额增加和异常处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是Silverlight开发的新手。我对此几乎没有疑问。


1)如何在页面加载时增加隔离存储(IS)配额大小。根据我的理解,需要用户启动的事件来弹出标准配额增加对话框。但我想在页面加载时弹出该对话框,而不是按下单击按钮
。换句话说,当应用程序加载时,我想检查IS大小。如果它小于50 MB我想向用户显示对话框以批准IS的50 MB大小。我该怎么办?


 


2)当我要使用以下代码行在IS中保存一些数据时/ p>

 IsolatedStorageSettings.ApplicationSettings.Remove(" MyCache"); 
IsolatedStorageSettings.ApplicationSettings.Add(" MyCache",Data);
IsolatedStorageSettings.ApplicationSettings.Save();


如果IS中剩余的空间较少且数据大小很大,则抛出异常。我不希望这种情况发生。什么时候抛出异常,我想从IS中清除旧数据,或者我想将IS的大小增加50MB。请告诉
我该怎么办?

如果您有任何其他问题,请不要犹豫。等待你的回复。


 


问候,


Sulaman


 

解决方案


Hi All,

I am new to silverlight development. I have few question regarding this.

1) How can I increase the isolated storage (IS) quota size on page load. According to my understanding, a user initiated event is required to pop up the standard quota increase dialogue box. But i want to pop up that dialogue box on page load rather then on a button click. In other words, when application loads, i want to check the IS size. If its less then 50 MB i want to show dialogue box to user to approve the 50 MB size for IS. How can i do it?

2) When i am going to save some data in IS by using the following lines of code

IsolatedStorageSettings.ApplicationSettings.Remove("MyCache");
IsolatedStorageSettings.ApplicationSettings.Add("MyCache", Data);
IsolatedStorageSettings.ApplicationSettings.Save();

if there is less space left in IS and size of data is large, then an exception is thrown. I don't want this to happen. When ever exception is going to be thrown, i want to clear the old data from IS or i want to increase the size of IS by 50MB. Kindly tell me how can i do it?

If you have any other question, plz don't hesitate to ask. Waiting for your reply.

Regards,

Sulaman

解决方案


这篇关于隔离存储配额增加和异常处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:49
查看更多