locked
Isolated Storage disk space RRS feed

  • Question

  • Hi

     

    I am wondering if the user will be prompted for 'increasing the quota' dialog if I try to write object bigger than 1MB in IS (through code-behind)?

    Or do I must invoke the IsolatedStorageFile.IncreaseQuotaTo()?

    If the latter, how should I know the optimal disk space needed, what should be the best practice?

     

    Thanks

    Friday, January 15, 2010 8:26 AM

Answers

  • Hi, 

    I am wondering if the user will be prompted for 'increasing the quota' dialog if I try to write object bigger than 1MB in IS (through code-behind)?

    There will be exception.

    Or do I must invoke the IsolatedStorageFile.IncreaseQuotaTo()?

    Yes.

    If the latter, how should I know the optimal disk space needed, what should be the best practice?

    If you will write some data to IS that you will write bytes so you will be to know how many space you need and you can request to user.

    Friday, January 15, 2010 8:44 AM

All replies

  • Hi, 

    I am wondering if the user will be prompted for 'increasing the quota' dialog if I try to write object bigger than 1MB in IS (through code-behind)?

    There will be exception.

    Or do I must invoke the IsolatedStorageFile.IncreaseQuotaTo()?

    Yes.

    If the latter, how should I know the optimal disk space needed, what should be the best practice?

    If you will write some data to IS that you will write bytes so you will be to know how many space you need and you can request to user.

    Friday, January 15, 2010 8:44 AM
  •  Hi Sergey,

     

    Thanks for the good answer.

    I have something more to ask though; 

    I was considering to save all variables in IS (only for the reason to read from IS when page is refreshed and then fill the static variables in the app) needed while the application lives; I was considering one big file, but stumbled upon several things:

    - making many sections in the file

    - complex for read/write

    - time consuming in any operation

     

    Now I'm considering to use multiple files (most probably I'll have many, i.e. ItemsSource of any grid in a separate files, specific forms data in separate files, etc...)

    So, my idea is to create these files in IS as I get the data for the first time (as I navigate through the pages, if the static data is null, create the IS file and fill the static variable respectively); Then:

    - on page refresh, I read it from IS and store it in static variables, then use it

    - on normal navigation, just use it from the static variables

     

     Excuse me for the long explanation,  but I needed to explain the above for the following questions:

     

    - Should I favor the multiple files approach more than the 'one file' one?

    - How long should I keep the data in IS? When delete it? I have problems in distinguishing the Refresh and Close Browser/Tab events!

     - How can I exactly know the total IS size needed, when I have multiple files, asynchronously created? I don't think that asking for permission after every file creation is suitable...


     

    Please advice me if I'm on the right track, or if you have anything to add to this or disapprove something...

     

    Thanks

    Monday, January 18, 2010 4:27 AM
  • Hi,

    There are cool article about Isolated Storage at MSDN. Have you seen it?

    Monday, January 18, 2010 1:41 PM
  • Hi,

    i have run more then one isolated storage related application in my windows phone 7 emulater. Here, i want get the space of isolated storage for particular application. is it possible? please help me.

    Friday, October 29, 2010 2:39 AM
  • Hi Mani,

    You can check UsedSize property of IsolatedStorageFile Class

    Tuesday, November 2, 2010 7:02 PM
  • Hi Sergey,

    the IsolatedStorageFile Class on Windows Phone does not have UsedSize property. Currently there seems to be no way to get the used space for isolated storage.

    Saturday, January 28, 2012 12:46 PM