This is a migrated thread and some comments may be shown as answers.

Check existence settings to load

1 Answer 115 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Pawel
Top achievements
Rank 1
Pawel asked on 23 Apr 2015, 11:07 AM

Is it possible to check if there are any settings to load for gridView before actual loading this settings? For example:

 

PersistenceManager.SetStorageId(gridView, storageId);
 
// how to check if there is some settings to load before actual loading settings happen?
 
_isoProvider.LoadFromStorage(storageId);

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 24 Apr 2015, 03:30 PM
Hello Pawel,

It is possible to check if there are any settings to load using FileExists(). In order to achieve this you should add a custom IsolatedStorageProvider which inherits IsolatedStorageProvider. In addition if you need to check the properties further, you can access the IsolatedStorageFileStream and write a custom logic: 
public class CustomIsolatedStorageProvider : IsolatedStorageProvider
{
    private static readonly string fileExtension = ".bin";
 
    public bool IsFileExist(string storageId)
    {
        var store = this.GetIsolatedStoreOverride();
        bool isExist = store.FileExists(storageId);
 
        //additional search
        if (!store.FileExists(storageId + CustomIsolatedStorageProvider.fileExtension))
            return isExist;
        using (IsolatedStorageFileStream fs = store.OpenFile(storageId + CustomIsolatedStorageProvider.fileExtension, FileMode.Open, FileAccess.Read))
        {
            // custom logic
        }
 
        return isExist;
    }

Unfortunately, at the moment there is a bug and GetIsolatedStoreOverride returns a wrong Isolated storage. You can track the progress of this issue in our Feedback portal. So, if you follow the feedback item you will be notified by email when its status changes. We cannot bound to any time frame for fixing the issue, but we will increase its priority and do our best to resolve it soon.
 
Thank you for your understanding.

Regards,
Milena
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
PersistenceFramework
Asked by
Pawel
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or