Skip to content

Commit 6d3d759

Browse files
Sullivan008Péter Kozák
authored and
Péter Kozák
committed
Remove unnecessary Classes, Comments and NuGet Packages, Packages Folder and BIN Folder from MDIApplicationDemo
1 parent ef56106 commit 6d3d759

File tree

52 files changed

+74
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+74
-178
lines changed
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
1+
using MDIApplicationDemo.Forms;
2+
using System;
53
using System.Windows.Forms;
64

75
namespace MDIApplicationDemo
86
{
9-
static class Control
10-
{
11-
/// <summary>
12-
/// The main entry point for the application.
13-
/// </summary>
14-
[STAThread]
15-
static void Main()
16-
{
17-
Application.EnableVisualStyles();
18-
Application.SetCompatibleTextRenderingDefault(false);
19-
Application.Run(new MDI());
20-
}
21-
}
7+
static class Control
8+
{
9+
/// <summary>
10+
/// The main entry point for the application.
11+
/// </summary>
12+
[STAThread]
13+
static void Main()
14+
{
15+
Application.EnableVisualStyles();
16+
Application.SetCompatibleTextRenderingDefault(false);
17+
Application.Run(new MDI());
18+
}
19+
}
2220
}

02_MDIApplicationDemo/MDIApplicationDemo/Forms/MDI.Designer.cs

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

02_MDIApplicationDemo/MDIApplicationDemo/Forms/MDI.cs

+20-25
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
using System.IO;
44
using System.Windows.Forms;
55

6-
namespace MDIApplicationDemo
6+
namespace MDIApplicationDemo.Forms
77
{
88
public partial class MDI : Form
9-
{
10-
/// <summary>
11-
/// Konstruktor.
12-
/// </summary>
13-
public MDI()
9+
{
10+
public MDI()
1411
{
1512
InitializeComponent();
1613
}
1714

1815
#region EVENTS
16+
1917
/// <summary>
2018
/// CLICK EVENT - Esemény, amely akkor fut le, hogyha valamelyik MENÜ ELEM-re (Menu Item) kattintunk.
2119
/// Az, hogy melyik Menu Item-re kattintottunk a SENDER-ben található TAG Property tartalmazza, és ez
@@ -43,25 +41,25 @@ private void MenuItems_Click(object sender, EventArgs e)
4341
case "Open":
4442
Open();
4543
break;
46-
default:
47-
break;
4844
}
4945
}
46+
5047
#endregion
5148

52-
#region Methods
49+
#region PRIVATE Action Methods
50+
5351
/// <summary>
5452
/// Az alkalmazás bezárását végrehajtó metódus.
5553
/// </summary>
5654
private void CloseWindow()
5755
{
58-
if (MessageBox.Show("Do you really want to quit?", "Exit", MessageBoxButtons.YesNo,
56+
if (MessageBox.Show(@"Do you really want to quit?", @"Exit", MessageBoxButtons.YesNo,
5957
MessageBoxIcon.Question) == DialogResult.Yes)
6058
{
6159
Application.Exit();
6260
}
6361
}
64-
62+
6563
/// <summary>
6664
/// Elkészít és megjelenít egy Notepad MDI CHILD FORM-ot az aktuális MDI FORM-hoz.
6765
/// </summary>
@@ -87,7 +85,7 @@ private void CreateAndShowPhotoViewerChild()
8785
/// </summary>
8886
private void CloseAcitveMDIChild()
8987
{
90-
ActiveMdiChild.Close();
88+
ActiveMdiChild?.Close();
9189

9290
SetCloseButtonsEnabled();
9391
}
@@ -114,15 +112,17 @@ private void Open()
114112
{
115113
using (OpenFileDialog openFileDialog = new OpenFileDialog())
116114
{
117-
openFileDialog.Filter = "Text File (*.txt)|*.txt|JPG Picture (*.jpg)|*.jpg";
115+
openFileDialog.Filter = @"Text File (*.txt)|*.txt|JPG Picture (*.jpg)|*.jpg";
118116

119117
if (openFileDialog.ShowDialog() == DialogResult.OK)
120118
{
121-
if (Path.GetExtension(openFileDialog.FileName).Equals(".txt"))
119+
string fileExtension = Path.GetExtension(openFileDialog.FileName);
120+
121+
if (fileExtension != null && fileExtension.Equals(".txt"))
122122
{
123123
OpenTextFileInMDIForm(openFileDialog.FileName);
124124
}
125-
else if (Path.GetExtension(openFileDialog.FileName).Equals(".jpg"))
125+
else if (fileExtension != null && fileExtension.Equals(".jpg"))
126126
{
127127
OpenPictureInMDIForm(openFileDialog.FileName);
128128
}
@@ -131,23 +131,18 @@ private void Open()
131131
}
132132
}
133133
}
134+
134135
#endregion
135136

136137
#region PRIVATE HELPER Methods
138+
137139
/// <summary>
138140
/// Beállítja a CLOSE TS MENU ITEM-ek ENABLED Property-jeit annak függvényében,
139141
/// hogy van-e még elérhető MDI Children az MDI Konténerben.
140142
/// </summary>
141143
private void SetCloseButtonsEnabled()
142144
{
143-
if (MdiChildren.Length != 0)
144-
{
145-
SetTSMenuItemsEnabledProperty(true, closeActiveTSMenuItem, closeAllTSMenuItem);
146-
}
147-
else
148-
{
149-
SetTSMenuItemsEnabledProperty(false, closeActiveTSMenuItem, closeAllTSMenuItem);
150-
}
145+
SetTSMenuItemsEnabledProperty(MdiChildren.Length != 0, closeActiveTSMenuItem, closeAllTSMenuItem);
151146
}
152147

153148
/// <summary>
@@ -197,7 +192,7 @@ private void OpenPictureInMDIForm(string filePath)
197192
/// Függvény amely elkészít egy Notepad Form Objektumot, amelynek a SZÜLŐ MDI az MDI FORM objektum.
198193
/// </summary>
199194
/// <returns>Notepad Form Objektum.</returns>
200-
private Notepad CreateNewNotepadForm() => new Notepad()
195+
private Notepad CreateNewNotepadForm() => new Notepad
201196
{
202197
MdiParent = this
203198
};
@@ -206,7 +201,7 @@ private void OpenPictureInMDIForm(string filePath)
206201
/// Függvény amely elkészít egy PhotoViewer Form Objektumot, amelynek a SZÜLŐ MDI az MDI FORM objektum.
207202
/// </summary>
208203
/// <returns>PhotoViewer Form Objektum.</returns>
209-
private PhotoViewer CreateNewPhotoViewerForm() => new PhotoViewer()
204+
private PhotoViewer CreateNewPhotoViewerForm() => new PhotoViewer
210205
{
211206
MdiParent = this
212207
};

02_MDIApplicationDemo/MDIApplicationDemo/Forms/Notepad.Designer.cs

+27-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
using System.Windows.Forms;
22

3-
namespace MDIApplicationDemo
3+
namespace MDIApplicationDemo.Forms
44
{
55
public partial class Notepad : Form
6-
{
7-
/// <summary>
8-
/// Konstruktor.
9-
/// </summary>
10-
public Notepad()
11-
{
12-
InitializeComponent();
13-
}
6+
{
7+
public Notepad()
8+
{
9+
InitializeComponent();
10+
}
1411

15-
/// <summary>
16-
/// Property, amely a FORM-on található INPUT RichTextBox-ot téríti vissza.
17-
/// </summary>
18-
public RichTextBox NotepadRichTextBox { get { return notepadRichTextBox; } }
19-
}
12+
public RichTextBox NotepadRichTextBox => notepadRichTextBox;
13+
}
2014
}

02_MDIApplicationDemo/MDIApplicationDemo/Forms/PhotoViewer.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
using System.Windows.Forms;
22

3-
namespace MDIApplicationDemo
3+
namespace MDIApplicationDemo.Forms
44
{
55
public partial class PhotoViewer : Form
66
{
7-
/// <summary>
8-
/// Konstruktor.
9-
/// </summary>
107
public PhotoViewer()
118
{
129
InitializeComponent();
1310
}
1411

15-
/// <summary>
16-
/// Property, amely a FORM-on található INPUT RichTextBox-ot téríti vissza.
17-
/// </summary>
18-
public PictureBox PictureBox { get { return pictureBox; } }
12+
public PictureBox PictureBox => pictureBox;
1913
}
2014
}

02_MDIApplicationDemo/MDIApplicationDemo/MDIApplicationDemo.csproj

-6
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@
3434
<ItemGroup>
3535
<Reference Include="System" />
3636
<Reference Include="System.Core" />
37-
<Reference Include="System.Xml.Linq" />
38-
<Reference Include="System.Data.DataSetExtensions" />
39-
<Reference Include="Microsoft.CSharp" />
40-
<Reference Include="System.Data" />
41-
<Reference Include="System.Deployment" />
4237
<Reference Include="System.Drawing" />
4338
<Reference Include="System.Windows.Forms" />
44-
<Reference Include="System.Xml" />
4539
</ItemGroup>
4640
<ItemGroup>
4741
<Compile Include="Forms\MDI.cs">
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/bin/Debug/MDIApplicationDemo.exe.config

-6
This file was deleted.
Binary file not shown.
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/bin/Debug/MDIApplicationDemo.vshost.exe.config

-6
This file was deleted.

02_MDIApplicationDemo/MDIApplicationDemo/bin/Debug/MDIApplicationDemo.vshost.exe.manifest

-11
This file was deleted.
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/bin/Release/MDIApplicationDemo.exe.config

-6
This file was deleted.
Binary file not shown.
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/bin/Release/MDIApplicationDemo.vshost.exe.config

-6
This file was deleted.

02_MDIApplicationDemo/MDIApplicationDemo/bin/Release/MDIApplicationDemo.vshost.exe.manifest

-11
This file was deleted.
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/obj/Debug/MDIApplicationDemo.csproj.FileListAbsolute.txt

-11
This file was deleted.
Binary file not shown.
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Whitespace-only changes.

02_MDIApplicationDemo/MDIApplicationDemo/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Whitespace-only changes.

02_MDIApplicationDemo/MDIApplicationDemo/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

Whitespace-only changes.
Binary file not shown.

02_MDIApplicationDemo/MDIApplicationDemo/obj/Release/MDIApplicationDemo.csproj.CoreCompileInputs.cache

-1
This file was deleted.

0 commit comments

Comments
 (0)