Skip to content

Commit 935b6dc

Browse files
committed
Clean code via CodeMaid
1 parent d37f997 commit 935b6dc

File tree

100 files changed

+668
-358
lines changed

Some content is hidden

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

100 files changed

+668
-358
lines changed

source/Components/Settings/Settings/Interfaces/IOptions.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
namespace Settings.Interfaces
22
{
3-
using Settings.ProgramSettings;
4-
using System.Collections.Generic;
5-
63
public interface IOptions
74
{
85
#region properties
6+
97
bool IsDirty { get; set; }
108
string LanguageSelected { get; set; }
119
bool ReloadOpenFilesOnAppStart { get; set; }
@@ -24,17 +22,21 @@ public interface IOptions
2422
int DefaultFontSize { get; }
2523
int FontSizeMin { get; }
2624
int FontSizeMax { get; }
25+
2726
#endregion properties
2827

2928
#region methods
29+
3030
/// <summary>
3131
/// Reset the dirty flag (e.g. after saving program options when they where edit).
3232
/// </summary>
3333
/// <param name="flag"></param>
3434
void SetDirtyFlag(bool flag);
3535

3636
void SetIconSize(int size);
37+
3738
void SetFontSize(int size);
39+
3840
#endregion methods
3941
}
40-
}
42+
}

source/Components/Settings/Settings/Interfaces/IProfile.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
{
33
using Settings.UserProfile;
44
using SettingsModel.Models;
5-
using System;
65
using System.Collections.Generic;
76

87
public interface IProfile
98
{
109
#region properties
10+
1111
string GetLastActivePath();
12-
string LastActiveSolution { get; set; }
1312

13+
string LastActiveSolution { get; set; }
1414

1515
string LastActiveTargetFile { get; set; }
1616

@@ -27,9 +27,11 @@ public interface IProfile
2727
/// Gets a collection of window position and size items.
2828
/// </summary>
2929
SerializableDictionary<string, ViewPosSizeModel> WindowPosSz { get; }
30+
3031
#endregion properties
3132

3233
#region methods
34+
3335
/// <summary>
3436
/// Checks the MainWindow for visibility when re-starting application
3537
/// (with different screen configuration).
@@ -45,6 +47,7 @@ public interface IProfile
4547
/// <param name="model"></param>
4648
/// <returns></returns>
4749
void UpdateInsertWindowPosSize(string windowName, ViewPosSizeModel model);
50+
4851
#endregion methods
4952
}
50-
}
53+
}

source/Components/Settings/Settings/Interfaces/ISettingsManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Settings.Interfaces
22
{
3-
using Settings.ProgramSettings;
43
using MLib.Interfaces;
4+
using Settings.ProgramSettings;
55
using System.Collections.Generic;
66
using System.Xml.Serialization;
77

@@ -22,6 +22,7 @@ public interface ISettingsManager : IOptionsPanel
2222
IEnumerable<LanguageCollection> GetSupportedLanguages();
2323

2424
#region properties
25+
2526
Settings.Interfaces.IProfile SessionData { get; }
2627

2728
int IconSizeMin { get; }
@@ -50,6 +51,7 @@ public interface ISettingsManager : IOptionsPanel
5051
/// </summary>
5152
[XmlIgnore]
5253
IThemeInfos Themes { get; }
54+
5355
#endregion properties
5456
}
55-
}
57+
}

source/Components/Settings/Settings/Interfaces/IViewPosSizeModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace Settings.Interfaces
22
{
3-
using System;
4-
53
public interface IViewPosSizeModel
64
{
75
bool DefaultConstruct { get; }
@@ -13,4 +11,4 @@ public interface IViewPosSizeModel
1311

1412
void SetValidPos(double SystemParameters_VirtualScreenLeft, double SystemParameters_VirtualScreenTop);
1513
}
16-
}
14+
}

source/Components/Settings/Settings/Internal/SettingsManagerImpl.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace Settings.Internal
22
{
3+
using MLib.Interfaces;
34
using Settings.Interfaces;
45
using Settings.ProgramSettings;
5-
using MLib.Interfaces;
66
using Settings.UserProfile;
77
using SettingsModel.Interfaces;
88
using System;
@@ -20,13 +20,16 @@
2020
internal class SettingsManagerImpl : ISettingsManager
2121
{
2222
#region fields
23+
2324
protected static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
2425
private readonly IOptionsPanel mSettingsDataPanel = null;
2526

2627
private IProfile mSessionData = null;
28+
2729
#endregion fields
2830

2931
#region constructor
32+
3033
/// <summary>
3134
/// Class cosntructor
3235
/// </summary>
@@ -44,9 +47,11 @@ protected SettingsManagerImpl()
4447
mSettingsDataPanel = new OptionsPanel();
4548
SessionData = new Profile();
4649
}
50+
4751
#endregion constructor
4852

4953
#region properties
54+
5055
/// <summary>
5156
/// Implement <seealso cref="IOptionsPanel"/> method to query options from model container.
5257
/// </summary>
@@ -76,6 +81,7 @@ private set
7681
}
7782

7883
#region min max definitions for useful option values
84+
7985
/// <summary>
8086
/// Gets the minimum font size that should be used in this application.
8187
/// </summary>
@@ -159,16 +165,19 @@ public int DefaultFixedFontSize
159165
return 12;
160166
}
161167
}
168+
162169
#endregion min max definitions for useful option values
163170

164171
/// <summary>
165172
/// Gets the internal name and Uri source for all available themes.
166173
/// </summary>
167174
[XmlIgnore]
168175
public IThemeInfos Themes { get; private set; }
176+
169177
#endregion properties
170178

171179
#region methods
180+
172181
/// <summary>
173182
/// Get a list of all supported languages in Edi.
174183
/// </summary>
@@ -196,6 +205,7 @@ public void CheckSettingsOnLoad(double SystemParameters_VirtualScreenLeft,
196205
}
197206

198207
#region Load Save UserSessionData
208+
199209
/// <summary>
200210
/// Save program options into persistence.
201211
/// See <seealso cref="SaveOptions"/> to save program options on program end.
@@ -279,10 +289,11 @@ public bool SaveSessionData(string sessionDataFileName, IProfile model)
279289
{
280290
if (xw != null)
281291
xw.Close(); // Cleanup
282-
283292
}
284293
}
294+
285295
#endregion Load Save UserSessionData
296+
286297
#endregion methods
287298
}
288-
}
299+
}

source/Components/Settings/Settings/ProgramSettings/LanguageCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/// <summary>
66
/// Base class for enumeration over languages (and their locale) that
77
/// are supported with specific (non-English) button and tool tip strings.
8-
///
8+
///
99
/// The class definition is based on BCP 47 which in turn is used to
1010
/// set the UI and thread culture (which in turn selects the correct
1111
/// string resource in MsgBox assembly).
@@ -43,4 +43,4 @@ public string DisplayName
4343
}
4444
}
4545
}
46-
}
46+
}

source/Components/Settings/Settings/ProgramSettings/OptionsPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ private set
2929
}
3030
}
3131
}
32-
}
32+
}

source/Components/Settings/Settings/SerializableDictionary.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@
1010
/// <summary>
1111
/// This class represents a serializable dictionary implementation
1212
/// of the standard generic dictionary class in .Net.
13-
///
13+
///
1414
/// Source: http://www.jankowskimichal.pl/en/2010/10/serializabledictionary/
1515
/// </summary>
1616
[Serializable]
1717
public class SerializableDictionary<TKey, TVal> : Dictionary<TKey, TVal>, IXmlSerializable, ISerializable
1818
{
1919
#region Private Members
20+
2021
private XmlSerializer _keySerializer;
2122
private XmlSerializer _valueSerializer;
22-
#endregion
23+
24+
#endregion Private Members
2325

2426
#region Constructors
27+
2528
public SerializableDictionary()
2629
{
2730
}
@@ -51,9 +54,10 @@ public SerializableDictionary(int capacity, IEqualityComparer<TKey> comparer)
5154
{
5255
}
5356

54-
#endregion
57+
#endregion Constructors
5558

5659
#region Private Properties
60+
5761
protected XmlSerializer ValueSerializer
5862
{
5963
get { return _valueSerializer ?? (_valueSerializer = new XmlSerializer(typeof(TVal))); }
@@ -63,9 +67,11 @@ private XmlSerializer KeySerializer
6367
{
6468
get { return _keySerializer ?? (_keySerializer = new XmlSerializer(typeof(TKey))); }
6569
}
66-
#endregion
70+
71+
#endregion Private Properties
6772

6873
#region ISerializable Members
74+
6975
protected SerializableDictionary(SerializationInfo info, StreamingContext context)
7076
{
7177
int itemCount = info.GetInt32("itemsCount");
@@ -86,9 +92,11 @@ void ISerializable.GetObjectData(SerializationInfo info, StreamingContext contex
8692
itemIdx++;
8793
}
8894
}
89-
#endregion
95+
96+
#endregion ISerializable Members
9097

9198
#region IXmlSerializable Members
99+
92100
void IXmlSerializable.WriteXml(XmlWriter writer)
93101
{
94102
foreach (KeyValuePair<TKey, TVal> kvp in this)
@@ -143,6 +151,7 @@ System.Xml.Schema.XmlSchema IXmlSerializable.GetSchema()
143151
{
144152
return null;
145153
}
146-
#endregion
154+
155+
#endregion IXmlSerializable Members
147156
}
148-
}
157+
}

source/Components/Settings/Settings/Settings.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
7979
<HintPath>..\..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
8080
</Reference>
81-
<Reference Include="MLib, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
82-
<HintPath>..\..\..\packages\Dirkster.MLib.1.2.0\lib\net4\MLib.dll</HintPath>
81+
<Reference Include="MLib, Version=1.3.1.2, Culture=neutral, processorArchitecture=MSIL">
82+
<HintPath>..\..\..\packages\Dirkster.MLib.1.3.1.2\lib\net40\MLib.dll</HintPath>
8383
</Reference>
8484
<Reference Include="PresentationFramework" />
8585
<Reference Include="System" />

source/Components/Settings/Settings/SettingsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public static ISettingsManager GetInstance(IThemeInfos themeInfos)
2727
return new SettingsManagerImpl(themeInfos);
2828
}
2929
}
30-
}
30+
}

0 commit comments

Comments
 (0)