/// <summary> /// index.xml を新規に作成します。 /// </summary> void CreateIndexFile() { indexFilePath = ResolveChildPath(indexFileName); index = new StorageDirectoryIndex(); using (var stream = container.CreateFile(indexFilePath)) { indexSerializer.Serialize(stream, index); } }
/// <summary> /// index.xml を読み込みます。 /// </summary> void LoadIndexFile() { indexFilePath = ResolveChildPath(indexFileName); if (!container.FileExists(indexFilePath)) { throw new InvalidOperationException(string.Format("The file '{0}' does not exists.", indexFilePath)); } using (var stream = container.OpenFile(indexFilePath, FileMode.Open)) { index = indexSerializer.Deserialize(stream) as StorageDirectoryIndex; } }
/// <summary> /// index.xml を読み込みます。 /// </summary> void LoadIndexFile() { indexFilePath = ResolveChildPath(indexFileName); if (!container.FileExists(indexFilePath)) throw new InvalidOperationException(string.Format("The file '{0}' does not exists.", indexFilePath)); using (var stream = container.OpenFile(indexFilePath, FileMode.Open)) { index = indexSerializer.Deserialize(stream) as StorageDirectoryIndex; } }