Skip to content

Commit 605fc4c

Browse files
committed
fixed warnings (added comments)
1 parent ac8e978 commit 605fc4c

File tree

11 files changed

+141
-62
lines changed

11 files changed

+141
-62
lines changed

ThinkSharp.FeatureTour.Test/Navigation/ActionRepositoryTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public void TestAddMultiTimes()
111111
[TestMethod]
112112
public void TestClear()
113113
{
114-
int a = 0;
115114
int b = 0;
116115
var repo = new ActionRepository();
117116
repo.AddAction("add", s => b++, s => true);

ThinkSharp.FeatureTour/Controls/Converters.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace ThinkSharp.FeatureTouring.Controls
99
{
10+
/// <summary>
11+
/// Converts the
12+
/// </summary>
1013
public class PlacementToAlignmentConverter : IValueConverter
1114
{
1215
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

ThinkSharp.FeatureTour/Helper/GenericXmlSerializer.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,16 @@ public static String Serialize<TItem>(TItem obj)
126126
}
127127

128128
/// <summary>
129-
/// Serializes the specified object to XML using the default serializer for the specified type.
129+
/// Serializes the specified object to XML using the default serializer for the specified type.
130130
/// </summary>
131131
/// <param name="obj">
132-
/// The object to serialize.
132+
/// The object to serialize.
133+
/// </param>
134+
/// <param name="type">
135+
/// The type to serialize.
133136
/// </param>
134137
/// <returns>
135-
/// The xml serialized object.
138+
/// The XML serialized object.
136139
/// </returns>
137140
public static String Serialize(Object obj, Type type)
138141
{

ThinkSharp.FeatureTour/Helper/IReleasable.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88

99
namespace ThinkSharp.FeatureTouring.Helper
1010
{
11+
/// <summary>
12+
/// Interface or releasable objects.
13+
/// </summary>
1114
public interface IReleasable
1215
{
16+
/// <summary>
17+
/// Releases the object.
18+
/// </summary>
1319
void Release();
1420
}
1521
}

ThinkSharp.FeatureTour/Logging/ConsoleLogger.cs

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,83 +5,103 @@
55

66
namespace ThinkSharp.FeatureTouring.Logging
77
{
8+
/// <summary>
9+
/// Logger that writes messages to the console (<see cref="Console.WriteLine(string)"/>).
10+
/// </summary>
811
public class ConsoleLogger : ILogger
912
{
1013
private readonly string myPrefix;
1114

15+
/// <summary>
16+
/// Creates a new instance of the class. This version does not use a prefix.
17+
/// </summary>
1218
public ConsoleLogger() : this("")
1319
{ }
1420

21+
/// <summary>
22+
/// Creates a new instance of the class.
23+
/// </summary>
24+
/// <param name="prefix">
25+
/// The prefix to use for all logging entries.
26+
/// </param>
1527
public ConsoleLogger(string prefix)
1628
{
1729
myPrefix = prefix;
1830
}
1931

32+
/// <summary>
33+
/// Log debug message.
34+
/// </summary>
35+
/// <param name="message">The message to log.</param>
2036
public void Debug(object message)
2137
{
2238
if (Debugger.IsAttached)
2339
WriteLog(message);
2440
}
41+
42+
/// <summary>
43+
/// Log debug message.
44+
/// </summary>
45+
/// <param name="message">The message to log.</param>
46+
/// <param name="exception">The exception to log.</param>
2547
public void Debug(object message, Exception exception)
2648
{
2749
if (Debugger.IsAttached)
2850
WriteLog(message + "; Exception: " + exception);
2951
}
30-
public void DebugFormat(string format, params object[] args)
31-
{
32-
if (Debugger.IsAttached)
33-
WriteLogFormat(format, args);
34-
}
52+
53+
/// <summary>
54+
/// Log error message.
55+
/// </summary>
56+
/// <param name="message">The message to log.</param>
3557
public void Error(object message)
3658
{
3759
if (Debugger.IsAttached)
3860
WriteLog(message);
3961
}
62+
63+
/// <summary>
64+
/// Log error message.
65+
/// </summary>
66+
/// <param name="message">The message to log.</param>
67+
/// <param name="exception">The exception to log.</param>
4068
public void Error(object message, Exception exception)
4169
{
4270
if (Debugger.IsAttached)
4371
WriteLog(message + "; Exception: " + exception);
4472
}
45-
public void ErrorFormat(string format, params object[] args)
46-
{
47-
if (Debugger.IsAttached)
48-
WriteLogFormat(format, args);
49-
}
5073
public void Info(object message)
5174
{
5275
if (Debugger.IsAttached)
5376
WriteLog(message);
5477
}
78+
79+
/// <summary>
80+
/// Log informational message.
81+
/// </summary>
82+
/// <param name="message">The message to log.</param>
83+
/// <param name="exception">The exception to log.</param>
5584
public void Info(object message, Exception exception)
5685
{
5786
if (Debugger.IsAttached)
5887
WriteLog(message + "; Exception: " + exception);
5988
}
60-
public void InfoFormat(string format, params object[] args)
61-
{
62-
if (Debugger.IsAttached)
63-
WriteLogFormat(format, args);
64-
}
6589
public void Warn(object message)
6690
{
6791
if (Debugger.IsAttached)
6892
WriteLog(message);
6993
}
94+
95+
/// <summary>
96+
/// Log warning message.
97+
/// </summary>
98+
/// <param name="message">The message to log.</param>
99+
/// <param name="exception">The exception to log.</param>
70100
public void Warn(object message, Exception exception)
71101
{
72102
if (Debugger.IsAttached)
73103
WriteLog(message + "; Exception: " + exception);
74104
}
75-
public void WarnFormat(string format, params object[] args)
76-
{
77-
if (Debugger.IsAttached)
78-
WriteLogFormat(format, args);
79-
}
80-
81-
private void WriteLogFormat(string logContent, params object[] parameters)
82-
{
83-
Console.WriteLine(myPrefix + ":" + logContent, parameters);
84-
}
85105

86106
private void WriteLog(object logContent)
87107
{

ThinkSharp.FeatureTour/Logging/ILogger.cs

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,54 @@
44

55
namespace ThinkSharp.FeatureTouring.Logging
66
{
7+
/// <summary>
8+
/// Interface for abstracting a logger.
9+
/// </summary>
710
public interface ILogger
811
{
12+
/// <summary>
13+
/// Log debug message.
14+
/// </summary>
15+
/// <param name="message">The message to log.</param>
916
void Debug(object message);
17+
/// <summary>
18+
/// Log debug message.
19+
/// </summary>
20+
/// <param name="message">The message to log.</param>
21+
/// <param name="exception">The exception to log.</param>
1022
void Debug(object message, Exception exception);
11-
void DebugFormat(string format, params object[] args);
23+
/// <summary>
24+
/// Log informational message.
25+
/// </summary>
26+
/// <param name="message">The message to log.</param>
1227
void Info(object message);
28+
/// <summary>
29+
/// Log informational message.
30+
/// </summary>
31+
/// <param name="message">The message to log.</param>
32+
/// <param name="exception">The exception to log.</param>
1333
void Info(object message, Exception exception);
14-
void InfoFormat(string format, params object[] args);
34+
/// <summary>
35+
/// Log warning message.
36+
/// </summary>
37+
/// <param name="message">The message to log.</param>
1538
void Warn(object message);
39+
/// <summary>
40+
/// Log warning message.
41+
/// </summary>
42+
/// <param name="message">The message to log.</param>
43+
/// <param name="exception">The exception to log.</param>
1644
void Warn(object message, Exception exception);
17-
void WarnFormat(string format, params object[] args);
45+
/// <summary>
46+
/// Log error message.
47+
/// </summary>
48+
/// <param name="message">The message to log.</param>
1849
void Error(object message);
50+
/// <summary>
51+
/// Log error message.
52+
/// </summary>
53+
/// <param name="message">The message to log.</param>
54+
/// <param name="exception">The exception to log.</param>
1955
void Error(object message, Exception exception);
20-
void ErrorFormat(string format, params object[] args);
2156
}
2257
}

ThinkSharp.FeatureTour/Logging/Log.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public static void Debug(object message, Exception exception)
2121
{
2222
theLogger.Debug(message, exception);
2323
}
24-
public static void DebugFormat(string format, params object[] args)
25-
{
26-
theLogger.DebugFormat(format, args);
27-
}
2824
public static void Info(object message)
2925
{
3026
theLogger.Info(message);
@@ -33,10 +29,6 @@ public static void Info(object message, Exception exception)
3329
{
3430
theLogger.Info(message, exception);
3531
}
36-
public static void InfoFormat(string format, params object[] args)
37-
{
38-
theLogger.InfoFormat(format, args);
39-
}
4032
public static void Warn(object message)
4133
{
4234
theLogger.Warn(message);
@@ -45,10 +37,6 @@ public static void Warn(object message, Exception exception)
4537
{
4638
theLogger.Debug(message, exception);
4739
}
48-
public static void WarnFormat(string format, params object[] args)
49-
{
50-
theLogger.WarnFormat(format, args);
51-
}
5240
public static void Error(object message)
5341
{
5442
theLogger.Error(message);
@@ -57,10 +45,5 @@ public static void Error(object message, Exception exception)
5745
{
5846
theLogger.Error(message, exception);
5947
}
60-
public static void ErrorFormat(string format, params object[] args)
61-
62-
{
63-
theLogger.ErrorFormat(format, args);
64-
}
6548
}
6649
}

ThinkSharp.FeatureTour/Logging/NullLogger.cs

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,61 @@
88

99
namespace ThinkSharp.FeatureTouring.Logging
1010
{
11+
/// <summary>
12+
/// Logger that ignores logging
13+
/// </summary>
1114
public class NullLogger : ILogger
1215
{
16+
/// <summary>
17+
/// Log debug message.
18+
/// </summary>
19+
/// <param name="message">The message to log.</param>
1320
public void Debug(object message) { }
1421

22+
/// <summary>
23+
/// Log debug message.
24+
/// </summary>
25+
/// <param name="message">The message to log.</param>
26+
/// <param name="exception">The exception to log.</param>
1527
public void Debug(object message, Exception exception) { }
1628

17-
public void DebugFormat(string format, params object[] args) { }
18-
29+
/// <summary>
30+
/// Log error message.
31+
/// </summary>
32+
/// <param name="message">The message to log.</param>
1933
public void Error(object message) { }
2034

35+
/// <summary>
36+
/// Log error message.
37+
/// </summary>
38+
/// <param name="message">The message to log.</param>
39+
/// <param name="exception">The exception to log.</param>
2140
public void Error(object message, Exception exception) { }
2241

23-
public void ErrorFormat(string format, params object[] args) { }
24-
42+
/// <summary>
43+
/// Log informational message.
44+
/// </summary>
45+
/// <param name="message">The message to log.</param>
2546
public void Info(object message) { }
2647

48+
/// <summary>
49+
/// Log informational message.
50+
/// </summary>
51+
/// <param name="message">The message to log.</param>
52+
/// <param name="exception">The exception to log.</param>
2753
public void Info(object message, Exception exception) { }
2854

29-
public void InfoFormat(string format, params object[] args) { }
30-
55+
/// <summary>
56+
/// Log warning message.
57+
/// </summary>
58+
/// <param name="message">The message to log.</param>
3159
public void Warn(object message) { }
3260

61+
/// <summary>
62+
/// Log warning message.
63+
/// </summary>
64+
/// <param name="message">The message to log.</param>
65+
/// <param name="exception">The exception to log.</param>
3366
public void Warn(object message, Exception exception) { }
34-
35-
public void WarnFormat(string format, params object[] args) { }
3667
}
3768
}

ThinkSharp.FeatureTour/Navigation/ActionRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public IReleasable AddAction(string name, Action<Step> executeAction)
2424
var execute = new ExecuteAction(executeAction);
2525

2626
if (myExecuteActions.ContainsKey(name))
27-
Log.WarnFormat($"Action with name '{name}' already exists. Will be overwritten!");
27+
Log.Warn($"Action with name '{name}' already exists. Will be overwritten!");
2828

2929
myExecuteActions[name] = execute;
3030

ThinkSharp.FeatureTour/TourRun.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ internal class TourRun : ITourRun
4343
private TourViewModel myTourViewModel;
4444
private StepNode myCurrentStepNode = null;
4545
private Guid myCurrentWindowID = Guid.Empty;
46-
private static string theFirstTourID = null;
47-
46+
4847
enum HandleWindowTransitionResult { ShowPopup, HidePopup, DoNothing }
4948

5049
// .ctor

0 commit comments

Comments
 (0)