-
Notifications
You must be signed in to change notification settings - Fork 6
/
StringResourceBrowserViewModel.cs
45 lines (37 loc) · 1.67 KB
/
StringResourceBrowserViewModel.cs
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
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using AP = ActiproSoftware.Properties;
namespace ActiproSoftware.SampleBrowser.Utilities.StringResourceBrowser {
/// <summary>
/// The string resource browser view model.
/// </summary>
public class StringResourceBrowserViewModel : ObservableObjectBase {
/////////////////////////////////////////////////////////////////////////////////////////////////////
// OBJECT
/////////////////////////////////////////////////////////////////////////////////////////////////////
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(AP.Shared.SR))] // Required to ensure SR.GetString method is available
public StringResourceBrowserViewModel() {
// Explicitly reference the string resource enum so reflection metadata is not trimmed
_ = Enum.GetValues<AP.Shared.SRName>();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
// PUBLIC PROCEDURES
/////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// The collection of all assemblies with string resources.
/// </summary>
/// <remarks>
/// This property must be updated whenever string resources are added to a new assembly.
/// </remarks>
public IEnumerable<AssemblyStringResourcesModel> All {
get {
return new AssemblyStringResourcesModel[] {
// Empty right now so temporarily excluding
// new AssemblyStringResourcesModel(typeof(AP.Fundamentals.SR), typeof(AP.Fundamentals.SRName)),
new AssemblyStringResourcesModel(typeof(AP.Shared.SR), typeof(AP.Shared.SRName)),
};
}
}
}
}