-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVsCSharpSource.cs
More file actions
47 lines (42 loc) · 1.85 KB
/
VsCSharpSource.cs
File metadata and controls
47 lines (42 loc) · 1.85 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//*****************************************************************************
//* Code Factory SDK
//* Copyright (c) 2020 CodeFactory, LLC
//*****************************************************************************
using System.Collections.Generic;
using System.Threading.Tasks;
using CodeFactory.DotNet.CSharp;
namespace CodeFactory.VisualStudio
{
/// <summary>
/// Data model that represents C# source code.
/// </summary>
public abstract class VsCSharpSource:VsModel,IVsCSharpSource
{
#region Property backing fields
private readonly CsSource _sourceCode;
#endregion
/// <summary>
/// Constructor for the base class <see cref="VsCSharpSource"/>
/// </summary>
/// <param name="isLoaded">Flag that determines if the model is loaded.</param>
/// <param name="hasErrors">Flag that determines if errors occurred while loading the model.</param>
/// <param name="modelErrors">The list of errors that occurred if any.</param>
/// <param name="name">The name of the model.</param>
/// <param name="sourceCode">The loaded C# model data.</param>
protected VsCSharpSource(bool isLoaded, bool hasErrors,
IReadOnlyList<ModelException<VisualStudioModelType>> modelErrors, string name,
CsSource sourceCode) : base(isLoaded, hasErrors, modelErrors, VisualStudioModelType.CSharpSource, name)
{
_sourceCode = sourceCode;
}
/// <summary>
/// The C# source in the document.
/// </summary>
public CsSource SourceCode => _sourceCode;
/// <summary>
/// Loads the visual studio document model from the current loaded source model.
/// </summary>
/// <returns>The loaded document model.</returns>
public abstract Task<VsDocument> LoadDocumentModelAsync();
}
}