Skip to content

Commit 8b70fea

Browse files
author
Ricardo Krause
committed
put github path to app.config
1 parent 7691432 commit 8b70fea

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

MainDemo.Wpf/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
<startup>
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
55
</startup>
6+
<appSettings>
7+
<add key="GitHub" value="https://github.com/ButchersBoy/MaterialDesignInXamlToolkit"/>
8+
</appSettings>
69
</configuration>

MainDemo.Wpf/Domain/DocumentationLink.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Configuration;
23
using System.Windows;
34
using System.Windows.Controls;
45
using System.Windows.Input;
@@ -22,14 +23,14 @@ public DocumentationLink(DocumentationLinkType type, string url, string label)
2223
public static DocumentationLink WikiLink(string page, string label)
2324
{
2425
return new DocumentationLink(DocumentationLinkType.Wiki,
25-
"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/wiki/" + page, label);
26+
$"{ConfigurationManager.AppSettings["GitHub"]}/wiki/" + page, label);
2627
}
2728

2829
public static DocumentationLink StyleLink(string nameChunk)
2930
{
3031
return new DocumentationLink(
3132
DocumentationLinkType.StyleSource,
32-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{nameChunk}.xaml",
33+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{nameChunk}.xaml",
3334
nameChunk);
3435
}
3536

@@ -39,7 +40,7 @@ public static DocumentationLink ApiLink<TClass>(string subNamespace)
3940

4041
return new DocumentationLink(
4142
DocumentationLinkType.ControlSource,
42-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/{subNamespace}/{typeName}.cs",
43+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/{subNamespace}/{typeName}.cs",
4344
typeName);
4445
}
4546

@@ -50,7 +51,7 @@ public static DocumentationLink ApiLink<TClass>()
5051

5152
return new DocumentationLink(
5253
DocumentationLinkType.ControlSource,
53-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/{typeName}.cs",
54+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/{typeName}.cs",
5455
typeName);
5556
}
5657

@@ -67,7 +68,7 @@ public static DocumentationLink DemoPageLink<TDemoPage>(string label)
6768

6869
return new DocumentationLink(
6970
DocumentationLinkType.DemoPageSource,
70-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MainDemo.Wpf/{typeof(TDemoPage).Name}.{ext}",
71+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MainDemo.Wpf/{typeof(TDemoPage).Name}.{ext}",
7172
label ?? typeof(TDemoPage).Name);
7273
}
7374

MainDemo.Wpf/Domain/MainWindowViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using MaterialDesignDemo;
1+
using System.Configuration;
2+
using MaterialDesignDemo;
23
using MaterialDesignDemo.Domain;
34
using MaterialDesignThemes.Wpf;
45
using MaterialDesignThemes.Wpf.Transitions;
@@ -15,7 +16,7 @@ public MainWindowViewModel()
1516
new DemoItem("Home", new Home(),
1617
new []
1718
{
18-
new DocumentationLink(DocumentationLinkType.Wiki, "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/wiki", "WIKI"),
19+
new DocumentationLink(DocumentationLinkType.Wiki, $"{ConfigurationManager.AppSettings["GitHub"]}/wiki", "WIKI"),
1920
DocumentationLink.DemoPageLink<Home>()
2021
}
2122
),

MainDemo.Wpf/Home.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Configuration;
34
using System.Diagnostics;
45
using System.Linq;
56
using System.Text;
@@ -28,7 +29,7 @@ public Home()
2829

2930
private void GitHubButton_OnClick(object sender, RoutedEventArgs e)
3031
{
31-
Process.Start("https://github.com/ButchersBoy/MaterialDesignInXamlToolkit");
32+
Process.Start(ConfigurationManager.AppSettings["GitHub"]);
3233
}
3334

3435
private void TwitterButton_OnClick(object sender, RoutedEventArgs e)

MainDemo.Wpf/MaterialDesignDemo.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</Compile>
5454
<Reference Include="PresentationFramework.Aero2" />
5555
<Reference Include="System" />
56+
<Reference Include="System.Configuration" />
5657
<Reference Include="System.Data" />
5758
<Reference Include="System.Xml" />
5859
<Reference Include="Microsoft.CSharp" />

0 commit comments

Comments
 (0)