forked from jexuswebserver/JexusManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelper.cs
56 lines (49 loc) · 1.87 KB
/
Helper.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
46
47
48
49
50
51
52
53
54
55
56
// Copyright (c) Lex Li. All rights reserved.
//
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Collections.Generic;
namespace Microsoft.Web.Administration
{
internal static class Helper
{
internal static bool IsRunningOnMono()
{
return Type.GetType("Mono.Runtime") != null;
}
internal static bool GetIsSni(this Binding binding)
{
var value = binding["sslFlags"];
return ((uint)value & 1U) == 1U;
}
internal static void GetAllDefinitions(this SectionGroup group, IList<SectionDefinition> result)
{
foreach (SectionDefinition item in group.Sections)
{
result.Add(item);
}
foreach (SectionGroup child in group.SectionGroups)
{
child.GetAllDefinitions(result);
}
}
public static readonly string FileNameMachineConfig = IsRunningOnMono()
? "/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/4.5/machine.config"
: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows),
"Microsoft.NET",
IntPtr.Size == 2 ? "Framework" : "Framework64",
"v4.0.30319",
"CONFIG",
"machine.config");
public static readonly string FileNameWebConfig = IsRunningOnMono()
? "/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/4.5/web.config"
: Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.Windows),
"Microsoft.NET",
IntPtr.Size == 2 ? "Framework" : "Framework64",
"v4.0.30319",
"CONFIG",
"web.config");
}
}