Skip to content

Commit d2e0df0

Browse files
committed
Commiting main files
1 parent 0f9e4dd commit d2e0df0

21 files changed

+1430
-0
lines changed

UIssueTracker.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27130.2020
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIssueTracker", "UIssueTracker\UIssueTracker.csproj", "{D48705BF-338B-4495-AC43-683DA1A687CB}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Debug|x64.ActiveCfg = Debug|Any CPU
17+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Debug|x64.Build.0 = Debug|Any CPU
18+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Debug|x86.ActiveCfg = Debug|Any CPU
19+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Debug|x86.Build.0 = Debug|Any CPU
20+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Release|x64.ActiveCfg = Release|Any CPU
21+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Release|x64.Build.0 = Release|Any CPU
22+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Release|x86.ActiveCfg = Release|Any CPU
23+
{D48705BF-338B-4495-AC43-683DA1A687CB}.Release|x86.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {3730186B-DCA8-49A7-AEBC-AC7A655BA8ED}
30+
EndGlobalSection
31+
EndGlobal

UIssueTracker/App.config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-1.6.13.0" newVersion="1.6.13.0" />
11+
</dependentAssembly>
12+
</assemblyBinding>
13+
</runtime>
14+
</configuration>

UIssueTracker/App.xaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Application x:Class="UIssueTracker.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:UIssueTracker"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
10+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepOrange.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.LightBlue.xaml" />
13+
</ResourceDictionary.MergedDictionaries>
14+
</ResourceDictionary>
15+
</Application.Resources>
16+
</Application>

UIssueTracker/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace UIssueTracker
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

UIssueTracker/Classes/Constants.cs

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
using System;
2+
using System.IO;
3+
using System.Text.RegularExpressions;
4+
using System.Windows.Media;
5+
using Newtonsoft.Json;
6+
using UIssueTracker.UserControls;
7+
using System.Collections.Generic;
8+
using Newtonsoft.Json.Linq;
9+
10+
namespace UIssueTracker.Classes
11+
{
12+
public class Constants
13+
{
14+
public static readonly string PRODUCT_NAME = "Unreal Issue Tracker";
15+
public static readonly string BUG_URL = @"https://issues.unrealengine.com/feed/bugs";
16+
public static readonly string FIX_URL = @"https://issues.unrealengine.com/feed/fixes";
17+
18+
private static readonly string IssueTrackerFileExtension = ".uitf";
19+
private static readonly string IssueFilesDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\" + PRODUCT_NAME + @"\";
20+
private static readonly string IssueTrackerHistoryDirectory = IssueFilesDirectory + @"History\";
21+
private static readonly string IssueTrackerHistoryFile = IssueTrackerHistoryDirectory + "IssueHistory.uithf";
22+
23+
public enum IssueResolution
24+
{
25+
Backlogged,
26+
ByDesign,
27+
CannotReproduce,
28+
Duplicate,
29+
Fixed,
30+
NonIssue,
31+
Unresolved,
32+
WontDo,
33+
WontFix,
34+
None
35+
}
36+
37+
private static void CreateIssueFileLocation()
38+
{
39+
if (Directory.Exists(IssueFilesDirectory) == false)
40+
{
41+
Directory.CreateDirectory(IssueFilesDirectory);
42+
}
43+
}
44+
45+
private static void CreateHistoryFile()
46+
{
47+
if (File.Exists(IssueTrackerHistoryFile) == false)
48+
{
49+
if (Directory.Exists(IssueTrackerHistoryDirectory) == false)
50+
{
51+
Directory.CreateDirectory(IssueTrackerHistoryDirectory);
52+
}
53+
JObject EmptyJson = new JObject();
54+
File.WriteAllText(IssueTrackerHistoryFile, EmptyJson.ToString(Formatting.Indented));
55+
}
56+
}
57+
58+
public static bool IsSubscribedToIssue(string IssueNumber)
59+
{
60+
return File.Exists(IssueFilesDirectory + IssueNumber + IssueTrackerFileExtension);
61+
}
62+
63+
public static bool SaveToHistory(IssueDetails issueDetails)
64+
{
65+
CreateHistoryFile();
66+
HistoryIssue historyIssue = JsonConvert.DeserializeObject<HistoryIssue>(File.ReadAllText(IssueTrackerHistoryFile));
67+
if (historyIssue.IssueHistory.ContainsKey(GetIssueNumber(issueDetails.IssueURL)) == false)
68+
{
69+
historyIssue.IssueHistory.Add(GetIssueNumber(issueDetails.IssueURL), issueDetails.CurrentIssueTitle);
70+
string serializedJson = JsonConvert.SerializeObject(historyIssue, Formatting.Indented);
71+
File.WriteAllText(IssueTrackerHistoryFile, serializedJson);
72+
return true;
73+
}
74+
return false;
75+
}
76+
77+
public static bool SubscribeToIssue(IssueDetails issueDetails)
78+
{
79+
CreateIssueFileLocation();
80+
string IssueNumber = GetIssueNumber(issueDetails.IssueURL);
81+
if (IsSubscribedToIssue(IssueNumber) == false)
82+
{
83+
SubscribeIssue subscribeIssue = new SubscribeIssue();
84+
subscribeIssue.SubscribedIssueResolution = issueDetails.CurrentIssueStatus;
85+
subscribeIssue.SubscribedIssueTitle = issueDetails.CurrentIssueTitle;
86+
subscribeIssue.SubscribedIssueID = IssueNumber;
87+
subscribeIssue.SubscribedIssueLink = issueDetails.IssueURL;
88+
subscribeIssue.SubscribedIssueDescription = issueDetails.CurrentIssueDescription;
89+
subscribeIssue.SubscribedIssueRepro = issueDetails.CurrentIssueRepro;
90+
subscribeIssue.SubscribedIssueMoreInfo = issueDetails.CurrentIssueAnswerHubLink;
91+
string SubscribeIssueJson = JsonConvert.SerializeObject(subscribeIssue, Formatting.Indented);
92+
File.WriteAllText(IssueFilesDirectory + IssueNumber + IssueTrackerFileExtension, SubscribeIssueJson);
93+
return true;
94+
}
95+
return false;
96+
}
97+
98+
public static void UnSubscribeFromIssue(string IssueNumber)
99+
{
100+
string FileLocation = IssueFilesDirectory + IssueNumber + IssueTrackerFileExtension;
101+
File.Delete(FileLocation);
102+
}
103+
104+
public static SubscribeIssue GetSubscribedIssue(string IssueFilePath)
105+
{
106+
return JsonConvert.DeserializeObject<SubscribeIssue>(File.ReadAllText(IssueFilePath));
107+
}
108+
109+
public static string GetIssueNumber(string IssueLink)
110+
{
111+
return IssueLink.Replace(@"https://issues.unrealengine.com/issue/", "");
112+
}
113+
114+
public static string GetIssueFilesDirectory()
115+
{
116+
return IssueFilesDirectory;
117+
}
118+
119+
public static string GetIssuesHistoryFile()
120+
{
121+
return IssueTrackerHistoryFile;
122+
}
123+
124+
public static SolidColorBrush ToSolidColorBrush(string hex_code)
125+
{
126+
return (SolidColorBrush)new BrushConverter().ConvertFromString(hex_code);
127+
}
128+
129+
public static IssueResolution GetResolution(string ResolutionName)
130+
{
131+
IssueResolution issueResolution = IssueResolution.None;
132+
switch (ResolutionName.ToLower())
133+
{
134+
case "backlogged":
135+
issueResolution = IssueResolution.Backlogged;
136+
break;
137+
case "by design":
138+
issueResolution = IssueResolution.ByDesign;
139+
break;
140+
case "cannot reproduce":
141+
issueResolution = IssueResolution.CannotReproduce;
142+
break;
143+
case "duplicate":
144+
issueResolution = IssueResolution.Duplicate;
145+
break;
146+
case "fixed":
147+
issueResolution = IssueResolution.Fixed;
148+
break;
149+
case "non-issue":
150+
issueResolution = IssueResolution.NonIssue;
151+
break;
152+
case "unresolved":
153+
issueResolution = IssueResolution.Unresolved;
154+
break;
155+
case "won't do":
156+
issueResolution = IssueResolution.WontDo;
157+
break;
158+
case "won't fix":
159+
issueResolution = IssueResolution.WontFix;
160+
break;
161+
default:
162+
break;
163+
164+
}
165+
return issueResolution;
166+
}
167+
168+
public static SolidColorBrush GetResolutionColor(string ResolutionName)
169+
{
170+
return GetColorByIssueResolution(GetResolution(ResolutionName));
171+
}
172+
173+
private static SolidColorBrush GetColorByIssueResolution(IssueResolution issueResolution)
174+
{
175+
string hex_code = "#FF304FFE";
176+
switch(issueResolution)
177+
{
178+
case IssueResolution.Backlogged:
179+
hex_code = "#FF7F261D";
180+
break;
181+
case IssueResolution.ByDesign:
182+
hex_code = "#FF27AE60";
183+
break;
184+
case IssueResolution.CannotReproduce:
185+
hex_code = "#FFF39C12";
186+
break;
187+
case IssueResolution.Duplicate:
188+
hex_code = "#FF95A5A6";
189+
break;
190+
case IssueResolution.Fixed:
191+
hex_code = "#FF2ECC71";
192+
break;
193+
case IssueResolution.NonIssue:
194+
hex_code = "#FFBBBBBB";
195+
break;
196+
case IssueResolution.Unresolved:
197+
hex_code = "#FFE74C3C";
198+
break;
199+
case IssueResolution.WontDo:
200+
hex_code = "#FF171717";
201+
break;
202+
case IssueResolution.WontFix:
203+
hex_code = "#FF34495E";
204+
break;
205+
default:
206+
break;
207+
208+
}
209+
return (SolidColorBrush)new BrushConverter().ConvertFromString(hex_code);
210+
}
211+
212+
public static string RemoveHtmlTags(string html)
213+
{
214+
string ReturnValue = html.Replace(@"amp;", string.Empty);
215+
Regex.Replace(ReturnValue, "<.+?>", string.Empty);
216+
return ReturnValue;
217+
}
218+
}
219+
220+
public class SubscribeIssue
221+
{
222+
public string SubscribedIssueID { get; set; }
223+
public string SubscribedIssueTitle { get; set; }
224+
public string SubscribedIssueResolution { get; set; }
225+
public string SubscribedIssueLink { get; set; }
226+
public string SubscribedIssueDescription { get; set; }
227+
public string SubscribedIssueRepro { get; set; }
228+
public string SubscribedIssueMoreInfo { get; set; } // AnswerHub or UDN link.
229+
}
230+
231+
public class HistoryIssue
232+
{
233+
public Dictionary<string, string> IssueHistory = new Dictionary<string, string>();
234+
}
235+
}

0 commit comments

Comments
 (0)