Skip to content

Commit

Permalink
Merge pull request #1018 from twpol/feature/consistent-namespaces/menu
Browse files Browse the repository at this point in the history
Refactor namespaces in Menu
  • Loading branch information
cjakeman authored Dec 29, 2024
2 parents 161fc82 + ad5ac8b commit 20e879b
Show file tree
Hide file tree
Showing 27 changed files with 76 additions and 77 deletions.
4 changes: 2 additions & 2 deletions Source/Menu/ContentForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Source/Menu/ContentForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
using System.Threading.Tasks;
using GNU.Gettext.WinForms;

namespace ORTS
namespace Menu
{
public partial class ContentForm : Form
{
Expand Down Expand Up @@ -1120,25 +1120,25 @@ private int determineSelectedIndex(ComboBox comboBox, string compareWith)
switch (classOfItem)
{
case "Folder":
comboboxName = ((Menu.Folder)comboBox.Items[index]).Name;
comboboxName = ((ORTS.Menu.Folder)comboBox.Items[index]).Name;
break;
case "Route":
comboboxName = ((Menu.Route)comboBox.Items[index]).Name;
comboboxName = ((ORTS.Menu.Route)comboBox.Items[index]).Name;
break;
case "DefaultExploreActivity":
comboboxName = ((Menu.Activity)comboBox.Items[index]).Name;
comboboxName = ((ORTS.Menu.Activity)comboBox.Items[index]).Name;
break;
case "Locomotive":
comboboxName = ((Menu.Locomotive)comboBox.Items[index]).Name;
comboboxName = ((ORTS.Menu.Locomotive)comboBox.Items[index]).Name;
break;
case "Consist":
comboboxName = ((Menu.Consist)comboBox.Items[index]).Name;
comboboxName = ((ORTS.Menu.Consist)comboBox.Items[index]).Name;
break;
case "String":
comboboxName = (string)comboBox.Items[index];
break;
case "Path":
comboboxName = ((Menu.Path)comboBox.Items[index]).End;
comboboxName = ((ORTS.Menu.Path)comboBox.Items[index]).End;
break;
case "KeyedComboBoxItem":
comboboxName = ((MainForm.KeyedComboBoxItem)comboBox.Items[index]).Value;
Expand Down
2 changes: 1 addition & 1 deletion Source/Menu/ImportExportSaveForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/Menu/ImportExportSaveForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using GNU.Gettext.WinForms;
using ORTS.Settings;

namespace ORTS
namespace Menu
{
public partial class ImportExportSaveForm : Form
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Menu/KeyInputControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/Menu/KeyInputControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using System.Windows.Forms;
using ORTS.Settings;

namespace ORTS
namespace Menu
{
/// <summary>
/// A control for viewing and altering keyboard input settings, in combination with <see cref="KeyInputEditControl"/>.
Expand Down
2 changes: 1 addition & 1 deletion Source/Menu/KeyInputEditControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/Menu/KeyInputEditControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using ORTS.Settings;
using Xna = Microsoft.Xna.Framework.Input;

namespace ORTS
namespace Menu
{
/// <summary>
/// A form used to edit keyboard input settings, in combination with <see cref="KeyInputControl"/>.
Expand Down
6 changes: 3 additions & 3 deletions Source/Menu/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Source/Menu/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using System.Windows.Forms;
using GNU.Gettext;
using GNU.Gettext.WinForms;
using Menu.Notifications;
using Orts.Formats.OR;
using ORTS.Common;
using ORTS.Menu;
Expand All @@ -35,7 +36,7 @@
using Activity = ORTS.Menu.Activity;
using Path = ORTS.Menu.Path;

namespace ORTS
namespace Menu
{
public partial class MainForm : Form
{
Expand Down Expand Up @@ -69,7 +70,7 @@ public enum UserAction
Task<List<Path>> PathLoader;
Task<List<TimetableInfo>> TimetableSetLoader;
Task<List<WeatherFileInfo>> TimetableWeatherFileLoader;
readonly ResourceManager Resources = new ResourceManager("ORTS.Properties.Resources", typeof(MainForm).Assembly);
readonly ResourceManager Resources = new ResourceManager("Menu.Properties.Resources", typeof(MainForm).Assembly);
readonly UpdateManager UpdateManager;
readonly Image ElevationIcon;
NotificationManager NotificationManager;
Expand Down
1 change: 0 additions & 1 deletion Source/Menu/Menu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<TargetFramework Condition="'$(BuildDotNet)' == 'true'">net6-windows</TargetFramework>
<TargetFramework Condition="'$(TargetFramework)' == ''">net472</TargetFramework>
<OutputType>WinExe</OutputType>
<RootNamespace>ORTS</RootNamespace>
<ApplicationIcon>..\ORTS.ico</ApplicationIcon>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
Expand Down
4 changes: 2 additions & 2 deletions Source/Menu/Notifications/NotificationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using ORTS.Settings;
using ORTS.Updater;
using static ORTS.Common.SystemInfo;
using static ORTS.NotificationPage;
using static Menu.Notifications.NotificationPage;

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

namespace ORTS
namespace Menu.Notifications
{
public class NotificationManager
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Menu/Notifications/NotificationPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using Button = System.Windows.Forms.Button;
using Image = System.Drawing.Image;

namespace ORTS
namespace Menu.Notifications
{
/// <summary>
/// Holds presentation details of the current notification displayed on the panel.
Expand Down
2 changes: 1 addition & 1 deletion Source/Menu/Notifications/Notifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using System.Collections.Generic;


namespace ORTS
namespace Menu.Notifications
{
public class Notifications
{
Expand Down
Loading

0 comments on commit 20e879b

Please sign in to comment.