Skip to content

Commit 7490f2c

Browse files
committed
Resolves review points
1 parent 8f473ce commit 7490f2c

File tree

3 files changed

+13
-30
lines changed

3 files changed

+13
-30
lines changed

Source/Menu/Notifications/NotificationManager.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// COPYRIGHT 2009, 2010, 2011, 2012, 2013, 2014, 2015 by the Open Rails project.
1+
// COPYRIGHT 2009 - 2024 by the Open Rails project.
22
//
33
// This file is part of Open Rails.
44
//
@@ -100,8 +100,8 @@ public void CheckNotifications()
100100
CurrentPageIndex = 0;
101101
Notifications = GetNotifications();
102102
ParameterDictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
103-
104-
// To support testing, add any overriding values to the ValueDictionary
103+
104+
// To support testing, add any overriding values to the ParameterDictionary
105105
GetOverrideParameters()?.ParameterValueList.ForEach(i => ParameterDictionary.Add(i.Parameter, i.Value));
106106
LogOverrideParameters();
107107

@@ -220,7 +220,7 @@ public void PopulatePage()
220220

221221
Page.NDetailList.Add(new NTitleControl(Panel, CurrentPageIndex + 1, list.Count, n.Date, n.Title));
222222

223-
// Check constraints foPageNoem
223+
// Check criteria for each item and add the successful items to the current page
224224
foreach (var item in n.ItemList)
225225
{
226226
if (AreItemChecksMet(item)) AddItemToPage(Page, item);
@@ -280,6 +280,11 @@ private bool AreNotificationChecksMet(Notification notification)
280280
return true;
281281
}
282282

283+
/// <summary>
284+
/// For the checks in the item, compares parameter values with criteria values
285+
/// </summary>
286+
/// <param name="item"></param>
287+
/// <returns></returns>
283288
private bool AreItemChecksMet(Item item)
284289
{
285290
if (item.IncludeIf != null || item.IncludeIfNot != null)

Source/Menu/Notifications/Notifications.cs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// COPYRIGHT 2009, 2010, 2011, 2012, 2013, 2014, 2015 by the Open Rails project.
1+
// COPYRIGHT 2009 - 2024 by the Open Rails project.
22
//
33
// This file is part of Open Rails.
44
//
@@ -73,51 +73,29 @@ public class Item
7373
public string Color { get; set; } = "black";
7474
public int Indent { get; set; } = 140;
7575
}
76-
//public class Met
77-
//{
78-
// public List<Item> ItemList { get; set; }
79-
// public List<CheckId> CheckIdList { get; set; }
80-
//}
81-
//public class CheckId
82-
//{
83-
// public string Id { get; set; }
84-
//}
8576

8677
public class Check
8778
{
8879
public string Id { get; set; }
8980
public List<AnyOf> AnyOfList { get; set; }
90-
//public List<Item> UnmetItemList { get; set; }
9181
}
9282

93-
//public class CheckAllOf
94-
//{
95-
// public List<Criteria> AllOfList { get; set; }
96-
//}
9783
public class AnyOf
9884
{
9985
public List<Criteria> AllOfList { get; set; }
10086
}
10187

102-
//public class Excludes : CheckAllOf
103-
//{
104-
//}
105-
106-
//public class Includes : CheckAllOf
107-
//{
108-
//}
109-
11088
class Contains : Criteria { }
11189
class NotContains : Criteria { }
11290

113-
// Not implemented yet
91+
// Not implemented as not needed yet
11492
// String comparison, not numerical
11593
class NoLessThan : Criteria { }
11694
class NoMoreThan : Criteria { }
11795

11896
public class Criteria
11997
{
120-
// System Information "examples"
98+
// System Information "examples"
12199
public string Property { get; set; } // installed_version, direct3d, runtime, system, memory, cpu, gpu
122100
public string Value { get; set; } // {{new_version}}, {{10_0}}
123101
}

Source/ORTS.Common/SystemInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static SystemInfo()
6969
{
7070
// Likely to catch multiple exceptions like:
7171
// Exception thrown: 'System.IO.InvalidDataException' in ORTS.Menu.dll
72-
//Trace.WriteLine(error);
72+
Trace.WriteLine(error);
7373
}
7474

7575
NativeMethods.GlobalMemoryStatusEx(MemoryStatusExtended);

0 commit comments

Comments
 (0)