-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCsSourceExtensions.cs
More file actions
25 lines (24 loc) · 1.11 KB
/
CsSourceExtensions.cs
File metadata and controls
25 lines (24 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//*****************************************************************************
//* Code Factory SDK
//* Copyright (c) 2022 CodeFactory, LLC
//*****************************************************************************
using CodeFactory.DotNet.CSharp;
namespace CodeFactory.Formatting.CSharp
{
/// <summary>
/// Extensions class that manage extensions that support CodeFactory models that implement the <see cref="CsSource"/> model.
/// </summary>
public static class CsSourceExtensions
{
/// <summary>
/// Creates a new instance of a namespace manager from a target model
/// </summary>
/// <param name="source">The model to load from.</param>
/// <param name="targetNamespace">The target namespace the manager supports.</param>
/// <returns>New instance of the namespace manager.</returns>
public static NamespaceManager LoadNamespaceManager(this CsSource source, string targetNamespace = null)
{
return source == null ? new NamespaceManager(null) : new NamespaceManager(source.NamespaceReferences,targetNamespace);
}
}
}