/// <summary> /// Construct a representation of a real remote file (or directory) /// </summary> /// <param name="app"></param> /// <param name="remoteFile"></param> private RemoteAppIsoStoreItem(RemoteApplicationEx app, IRemoteFileInfo remoteFile, IRemoteIsolatedStorageFile remoteStore, RemoteAppIsoStoreItem parent) { RemoteApp = app.RemoteApplication; _remoteStore = remoteStore; _appEx = app; Parent = parent; RemoteFile = remoteFile; // if we can't get the internal object, set it back to the default, which is remoteFile itself. // remoteFile only exposes a subset of properties, but these are better than none RemoteFileInfo = (object)remoteFile.GetInternalRemoteFileInfo() ?? (object)remoteFile; string name = RemoteFile.Name; Name = Path.GetFileName(name); // "\\Applications\\Data\\8531f2be-f4c3-4822-9fa6-bcc70c9d50a8\\Data\\IsolatedStore\\\\Shared" _path = RemoteFile.GetRelativePath(); // Modern applications are rooted by their IsoStore object so don't need the full path if (_path.Contains("%")) { _path = ""; } if (RemoteFile.IsDirectory()) { Children.Add(new FakeRemoteAppIsoStoreItem(this)); } }
/// <summary> /// Used to create a fake entry so that directories can be queried /// </summary> internal RemoteAppIsoStoreItem(RemoteAppIsoStoreItem parent) { Parent = parent; }