/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Scripting/Core/Hosting/AssemblyLoader/MetadataShadowCopy.cs
50 строк
2 KB
Jared Parsons
generated move
28 сен 2020, 19:36
28 сен 2020, 19:36
1cca63b
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Diagnostics; namespace Microsoft.CodeAnalysis.Scripting.Hosting { /// <summary> /// Represents a shadow copy of an assembly or a standalone module. /// </summary> public sealed class MetadataShadowCopy { /// <summary> /// Assembly manifest module copy or a standalone module copy. /// </summary> public FileShadowCopy PrimaryModule { get; } /// <summary> /// Documentation file copy or null if there is none. /// </summary> /// <remarks> /// Documentation files are currently only supported for manifest modules, not modules included in an assembly. /// </remarks> public FileShadowCopy DocumentationFile { get; } // this instance doesn't own the image public Metadata Metadata { get; } internal MetadataShadowCopy(FileShadowCopy primaryModule, FileShadowCopy documentationFileOpt, Metadata metadataCopy) { Debug.Assert(primaryModule != null); Debug.Assert(metadataCopy != null); ////Debug.Assert(!metadataCopy.IsImageOwner); property is now internal PrimaryModule = primaryModule; DocumentationFile = documentationFileOpt; Metadata = metadataCopy; } // keep this internal so that users can't delete files that the provider manages internal void DisposeFileHandles() { PrimaryModule.DisposeFileStream(); DocumentationFile?.DisposeFileStream(); } } }