Registry Mirror
搜索
Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Files
Expand file tree
main
Breadcrumbs
CodeName.Styling
/
StyleClassNodeUtility.cs
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
34 lines (30 loc) · 855 Bytes
main
Breadcrumbs
CodeName.Styling
/
StyleClassNodeUtility.cs
Copy path
Top
File metadata and controls
Code
Blame
34 lines (30 loc) · 855 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
namespace CodeName.Styling
{
public static class StyleClassNodeUtility
{
public static bool HasClassOnParent(this IStyleClassNode node, string styleClass)
{
var parent = node.Parent;
while (parent != null)
{
if (parent.HasClass(styleClass))
{
return true;
}
parent = parent.Parent;
}
return false;
}
public static bool HasClassOnChild(this IStyleClassNode node, string styleClass)
{
foreach (var child in node.Children)
{
if (child.HasClass(styleClass) || HasClassOnChild(child, styleClass))
{
return true;
}
}
return false;
}
}
}
You can’t perform that action at this time.