forked from jexuswebserver/JexusManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHiddenSegmentsItem.cs
42 lines (35 loc) · 1.11 KB
/
HiddenSegmentsItem.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
// Copyright (c) Lex Li. All rights reserved.
//
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace JexusManager.Features.RequestFiltering
{
using Microsoft.Web.Administration;
internal class HiddenSegmentsItem : IItem<HiddenSegmentsItem>
{
public HiddenSegmentsItem(ConfigurationElement element)
{
Flag = element == null || element.IsLocallyStored ? "Local" : "Inherited";
Element = element;
if (element == null)
{
return;
}
Segment = (string)element["segment"];
}
public string Segment { get; set; }
public string Flag { get; set; }
public ConfigurationElement Element { get; set; }
public bool Equals(HiddenSegmentsItem other)
{
return Match(other);
}
public bool Match(HiddenSegmentsItem other)
{
return other != null && other.Segment == Segment;
}
public void Apply()
{
Element["segment"] = Segment;
}
}
}