IsolatedStorageFile.GetUserStoreForApplication() would previously throw an
IsolatedStorageException because no ApplicationIdentity was provided by the
AppDomain.
We would like to provide this method in a workable fashion to facilitate code
portability with Windows Phone 7, which exposes only this method for saving
files to stable storage.
Thus, skip the ApplicationIdentity and code identity checks for MOBILE
(MonoDroid, MonoTouch) so that IsolatedStorage Just Works.
[MonoTODO ("requires manifest support")]
protected void InitStore (IsolatedStorageScope scope, Type appEvidenceType)
{
+#if !MOBILE
if (AppDomain.CurrentDomain.ApplicationIdentity == null)
throw new IsolatedStorageException (Locale.GetText ("No ApplicationIdentity available for AppDomain."));
if (appEvidenceType == null) {
// TODO - Choose evidence
}
+#endif
// no exception here because this can work without CAS
storage_scope = scope;
{
string root = GetIsolatedStorageRoot (Scope);
string dir = null;
+#if MOBILE
+ dir = "";
+#else
if (_applicationIdentity != null) {
dir = String.Format ("a{0}{1}", SeparatorInternal, GetNameFromIdentity (_applicationIdentity));
} else if (_domainIdentity != null) {
} else {
throw new IsolatedStorageException (Locale.GetText ("No code identity available."));
}
+#endif
root = Path.Combine (root, dir);