Skip to content

Commit 20e879b

Browse files
authored
Merge pull request #1018 from twpol/feature/consistent-namespaces/menu
Refactor namespaces in Menu
2 parents 161fc82 + ad5ac8b commit 20e879b

27 files changed

+76
-77
lines changed

Source/Menu/ContentForm.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/ContentForm.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
using System.Threading.Tasks;
3434
using GNU.Gettext.WinForms;
3535

36-
namespace ORTS
36+
namespace Menu
3737
{
3838
public partial class ContentForm : Form
3939
{
@@ -1120,25 +1120,25 @@ private int determineSelectedIndex(ComboBox comboBox, string compareWith)
11201120
switch (classOfItem)
11211121
{
11221122
case "Folder":
1123-
comboboxName = ((Menu.Folder)comboBox.Items[index]).Name;
1123+
comboboxName = ((ORTS.Menu.Folder)comboBox.Items[index]).Name;
11241124
break;
11251125
case "Route":
1126-
comboboxName = ((Menu.Route)comboBox.Items[index]).Name;
1126+
comboboxName = ((ORTS.Menu.Route)comboBox.Items[index]).Name;
11271127
break;
11281128
case "DefaultExploreActivity":
1129-
comboboxName = ((Menu.Activity)comboBox.Items[index]).Name;
1129+
comboboxName = ((ORTS.Menu.Activity)comboBox.Items[index]).Name;
11301130
break;
11311131
case "Locomotive":
1132-
comboboxName = ((Menu.Locomotive)comboBox.Items[index]).Name;
1132+
comboboxName = ((ORTS.Menu.Locomotive)comboBox.Items[index]).Name;
11331133
break;
11341134
case "Consist":
1135-
comboboxName = ((Menu.Consist)comboBox.Items[index]).Name;
1135+
comboboxName = ((ORTS.Menu.Consist)comboBox.Items[index]).Name;
11361136
break;
11371137
case "String":
11381138
comboboxName = (string)comboBox.Items[index];
11391139
break;
11401140
case "Path":
1141-
comboboxName = ((Menu.Path)comboBox.Items[index]).End;
1141+
comboboxName = ((ORTS.Menu.Path)comboBox.Items[index]).End;
11421142
break;
11431143
case "KeyedComboBoxItem":
11441144
comboboxName = ((MainForm.KeyedComboBoxItem)comboBox.Items[index]).Value;

Source/Menu/ImportExportSaveForm.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/ImportExportSaveForm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using GNU.Gettext.WinForms;
2626
using ORTS.Settings;
2727

28-
namespace ORTS
28+
namespace Menu
2929
{
3030
public partial class ImportExportSaveForm : Form
3131
{

Source/Menu/KeyInputControl.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/KeyInputControl.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using System.Windows.Forms;
2121
using ORTS.Settings;
2222

23-
namespace ORTS
23+
namespace Menu
2424
{
2525
/// <summary>
2626
/// A control for viewing and altering keyboard input settings, in combination with <see cref="KeyInputEditControl"/>.

Source/Menu/KeyInputEditControl.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/KeyInputEditControl.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
using ORTS.Settings;
2424
using Xna = Microsoft.Xna.Framework.Input;
2525

26-
namespace ORTS
26+
namespace Menu
2727
{
2828
/// <summary>
2929
/// A form used to edit keyboard input settings, in combination with <see cref="KeyInputControl"/>.

Source/Menu/MainForm.Designer.cs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/MainForm.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using System.Windows.Forms;
2828
using GNU.Gettext;
2929
using GNU.Gettext.WinForms;
30+
using Menu.Notifications;
3031
using Orts.Formats.OR;
3132
using ORTS.Common;
3233
using ORTS.Menu;
@@ -35,7 +36,7 @@
3536
using Activity = ORTS.Menu.Activity;
3637
using Path = ORTS.Menu.Path;
3738

38-
namespace ORTS
39+
namespace Menu
3940
{
4041
public partial class MainForm : Form
4142
{
@@ -69,7 +70,7 @@ public enum UserAction
6970
Task<List<Path>> PathLoader;
7071
Task<List<TimetableInfo>> TimetableSetLoader;
7172
Task<List<WeatherFileInfo>> TimetableWeatherFileLoader;
72-
readonly ResourceManager Resources = new ResourceManager("ORTS.Properties.Resources", typeof(MainForm).Assembly);
73+
readonly ResourceManager Resources = new ResourceManager("Menu.Properties.Resources", typeof(MainForm).Assembly);
7374
readonly UpdateManager UpdateManager;
7475
readonly Image ElevationIcon;
7576
NotificationManager NotificationManager;

Source/Menu/Menu.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<TargetFramework Condition="'$(BuildDotNet)' == 'true'">net6-windows</TargetFramework>
44
<TargetFramework Condition="'$(TargetFramework)' == ''">net472</TargetFramework>
55
<OutputType>WinExe</OutputType>
6-
<RootNamespace>ORTS</RootNamespace>
76
<ApplicationIcon>..\ORTS.ico</ApplicationIcon>
87
<UseWindowsForms>true</UseWindowsForms>
98
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>

Source/Menu/Notifications/NotificationManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
using ORTS.Settings;
3232
using ORTS.Updater;
3333
using static ORTS.Common.SystemInfo;
34-
using static ORTS.NotificationPage;
34+
using static Menu.Notifications.NotificationPage;
3535

3636
// Behaviour
3737
// Notifications are read only once as a background task at start into Notifications.
@@ -40,7 +40,7 @@
4040
// the visibility of each notification in NotificationList is re-assessed. Also its date.
4141
// Every time the user selects a different notification page, the panel is re-loaded with items for that page.
4242

43-
namespace ORTS
43+
namespace Menu.Notifications
4444
{
4545
public class NotificationManager
4646
{

Source/Menu/Notifications/NotificationPage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
using Button = System.Windows.Forms.Button;
2525
using Image = System.Drawing.Image;
2626

27-
namespace ORTS
27+
namespace Menu.Notifications
2828
{
2929
/// <summary>
3030
/// Holds presentation details of the current notification displayed on the panel.

Source/Menu/Notifications/Notifications.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using System.Collections.Generic;
1919

2020

21-
namespace ORTS
21+
namespace Menu.Notifications
2222
{
2323
public class Notifications
2424
{

0 commit comments

Comments
 (0)