private static ServicingIndex LoadIndex() { return LazyInitializer.EnsureInitialized(ref _index, ref _indexInitialized, ref _indexSync, () => { var index = new ServicingIndex(); var servicingRoot = GetServicingRoot(); if (servicingRoot != null) { index.Initialize(servicingRoot); } return index; }); }
private static ServicingIndex LoadIndex() { return(LazyInitializer.EnsureInitialized(ref _index, ref _indexInitialized, ref _indexSync, () => { var index = new ServicingIndex(); var servicingRoot = GetServicingRoot(); if (servicingRoot != null) { index.Initialize(servicingRoot); } return index; })); }
private static void ServicingTest(string indexContent, Action<ServicingIndex, string> validator) { const string fakePatchesFolder = @"C:/foo/patchesFolder/"; using (MemoryStream indexStream = new MemoryStream(Encoding.UTF8.GetBytes(indexContent))) { var index = new ServicingIndex(); index.Initialize(fakePatchesFolder, indexStream); validator(index, fakePatchesFolder); } }