MCPcopy Create free account
hub / github.com/GPUOpen-Tools/GPU-Reshape / GetIcon

Method GetIcon

Source/UIX/Studio/ResourceLocator.cs:82–101  ·  view source on GitHub ↗

Get an icon from key icon key null if not found

(string name)

Source from the content-addressed store, hash-verified

80 /// <param name="name">icon key</param>
81 /// <returns>null if not found</returns>
82 public static StreamGeometry? GetIcon(string name)
83 {
84 // May not exist
85 if (!Application.Current!.Styles.TryGetResource(name, null, out object? resource))
86 {
87#if DEBUG
88 Debug.WriteLine($"ResourceLocator - Failed to find icon '{name}'");
89#endif // DEBUG
90 return null;
91 }
92
93#if DEBUG
94 if (resource is not StreamGeometry)
95 {
96 Debug.WriteLine($"ResourceLocator - Failed to convert resource '{name}' from {resource?.GetType()} to StreamGeometry");
97 }
98#endif // DEBUG
99
100 return resource as StreamGeometry;
101 }
102 }
103}

Calls

no outgoing calls

Tested by

no test coverage detected