Skip to content

Commit a9c85c4

Browse files
committed
Update
1 parent ee8eeb2 commit a9c85c4

29 files changed

Lines changed: 257 additions & 123 deletions

Source/NETworkManager.Models/ApplicationInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ApplicationInfo
1616
public bool IsVisible { get; set; }
1717

1818
/// <summary>
19-
/// Create an <see cref="ApplicationInfo"/>.
19+
/// Create an empty <see cref="ApplicationInfo"/>.
2020
/// </summary>
2121
public ApplicationInfo()
2222
{

Source/NETworkManager.Utilities/ArrayHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace NETworkManager.Utilities
44
{
55
/// <summary>
6-
/// This class contains a collection of useful methods to interact with an array.
6+
/// Class contains a collection of useful methods to interact with an array.
77
/// </summary>
88
public static class ArrayHelper
99
{
Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
using System;
22
using System.Collections.Generic;
3-
using NETworkManager.Enum;
43

54
namespace NETworkManager.Utilities
65
{
6+
/// <summary>
7+
/// Class provides methods to manage auto refresh time.
8+
/// </summary>
79
public static class AutoRefreshTime
810
{
9-
public static List<AutoRefreshTimeInfo> Defaults => new List<AutoRefreshTimeInfo>
11+
/// <summary>
12+
/// Method returns a list with default <see cref="AutoRefreshTimeInfo"/>s.
13+
/// </summary>
14+
public static IEnumerable<AutoRefreshTimeInfo> GetDefaults => new List<AutoRefreshTimeInfo>
1015
{
1116
new AutoRefreshTimeInfo(5, TimeUnit.Second),
1217
new AutoRefreshTimeInfo(15, TimeUnit.Second),
@@ -15,20 +20,54 @@ public static class AutoRefreshTime
1520
new AutoRefreshTimeInfo(5, TimeUnit.Minute),
1621
};
1722

23+
/// <summary>
24+
/// Method to calculate a <see cref="TimeSpan"/> based on <see cref="AutoRefreshTimeInfo"/>.
25+
/// </summary>
26+
/// <param name="info"><see cref="AutoRefreshTimeInfo"/> to calculate <see cref="TimeSpan"/></param>
27+
/// <returns>Returns the calculated <see cref="TimeSpan"/>.</returns>
1828
public static TimeSpan CalculateTimeSpan(AutoRefreshTimeInfo info)
1929
{
2030
switch (info.TimeUnit)
2131
{
22-
// Seconds
32+
// Calculate the seconds
2333
case TimeUnit.Second:
2434
return new TimeSpan(0, 0, info.Value);
25-
// Minutes
35+
// Calculate the minutes
2636
case TimeUnit.Minute:
2737
return new TimeSpan(0, info.Value * 60, 0);
28-
// Hours
29-
default:
38+
// Calculate the hours
39+
case TimeUnit.Hour:
3040
return new TimeSpan(info.Value * 60, 0, 0);
41+
case TimeUnit.None:
42+
default:
43+
throw new Exception("Wrong time unit.");
3144
}
3245
}
46+
47+
/// <summary>
48+
/// Enum for time units.
49+
/// </summary>
50+
public enum TimeUnit
51+
{
52+
/// <summary>
53+
/// No time unit.
54+
/// </summary>
55+
None,
56+
57+
/// <summary>
58+
/// Second(s) time unit.
59+
/// </summary>
60+
Second,
61+
62+
/// <summary>
63+
/// Minute(s) time unit.
64+
/// </summary>
65+
Minute,
66+
67+
/// <summary>
68+
/// Hour(s) time unit.
69+
/// </summary>
70+
Hour
71+
}
3372
}
3473
}

Source/NETworkManager.Utilities/AutoRefreshTimeInfo.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
1-
using NETworkManager.Enum;
1+
using static NETworkManager.Utilities.AutoRefreshTime;
22

33
namespace NETworkManager.Utilities
44
{
5+
/// <summary>
6+
/// Class to store auto refresh time informations.
7+
/// </summary>
58
public class AutoRefreshTimeInfo
69
{
10+
/// <summary>
11+
/// Value is combined with <see cref="AutoRefreshTime.TimeUnit"/>.
12+
/// Example: 5 Mintues, 2 Hours.
13+
/// </summary>
714
public int Value { get; set; }
15+
16+
/// <summary>
17+
/// <see cref="AutoRefreshTime.TimeUnit"/> is combined with <see cref="Value"/>.
18+
/// </summary>
819
public TimeUnit TimeUnit { get; set; }
920

21+
/// <summary>
22+
/// Create an empty <see cref="AutoRefreshTimeInfo"/>.
23+
/// </summary>
1024
public AutoRefreshTimeInfo()
1125
{
1226

1327
}
1428

29+
/// <summary>
30+
/// Create an <see cref="AutoRefreshTimeInfo"/> with values.
31+
/// </summary>
32+
/// <param name="value"><see cref="Value"/>.</param>
33+
/// <param name="timenUnit"><see cref="TimeUnit"/>.</param>
1534
public AutoRefreshTimeInfo(int value, TimeUnit timenUnit)
1635
{
1736
Value = value;

Source/NETworkManager.Utilities/AutoRefreshTimeUnit.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Windows;
2+
3+
namespace NETworkManager.Utilities
4+
{
5+
/// <summary>
6+
/// Class for static common methods.
7+
/// </summary>
8+
public static class ClipboardHelper
9+
{
10+
/// <summary>
11+
/// Methods to set a text to the clipboard.
12+
/// </summary>
13+
/// <param name="text">Some text...</param>
14+
public static void SetClipboard(string text)
15+
{
16+
Clipboard.SetDataObject(text, true);
17+
}
18+
}
19+
}

Source/NETworkManager.Utilities/CommonMethods.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

Source/NETworkManager.Utilities/CustomCommand.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@
44

55
namespace NETworkManager.Utilities
66
{
7+
/// <summary>
8+
///
9+
/// </summary>
710
public static class CustomCommand
811
{
9-
public static List<CustomCommandInfo> DefaultList()
12+
/// <summary>
13+
///
14+
/// </summary>
15+
public static List<CustomCommandInfo> GetDefaults() => new List<CustomCommandInfo>
1016
{
11-
return new List<CustomCommandInfo>
12-
{
13-
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer", "iexplore.exe", @"http://$$ipaddress$$/"),
14-
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer (https)", "iexplore.exe", @"https://$$ipaddress$$/"),
15-
new CustomCommandInfo(Guid.NewGuid(), "Windows Explorer (c$)", "explorer.exe", @"\\$$ipaddress$$\c$"),
16-
};
17-
}
17+
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer", "iexplore.exe", @"http://$$ipaddress$$/"),
18+
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer (https)", "iexplore.exe", @"https://$$ipaddress$$/"),
19+
new CustomCommandInfo(Guid.NewGuid(), "Windows Explorer (c$)", "explorer.exe", @"\\$$ipaddress$$\c$"),
20+
};
1821

22+
/// <summary>
23+
///
24+
/// </summary>
1925
public static void Run(CustomCommandInfo info)
2026
{
2127
if (string.IsNullOrEmpty(info.Arguments))

Source/NETworkManager.Utilities/CustomCommandInfo.cs

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,64 @@
22

33
namespace NETworkManager.Utilities
44
{
5+
/// <summary>
6+
/// Class to store custom command informations.
7+
/// </summary>
58
public class CustomCommandInfo : ICloneable
69
{
10+
11+
/// <summary>
12+
/// Unique Identifiert for this custom command.
13+
/// </summary>
714
public Guid ID { get; set; }
8-
15+
16+
/// <summary>
17+
/// Name of this custom command.
18+
/// </summary>
919
public string Name { get; set; }
20+
21+
/// <summary>
22+
/// Filepath to the application to execute.
23+
/// </summary>
1024
public string FilePath { get; set; }
25+
26+
/// <summary>
27+
/// Arguments to start the application.
28+
/// </summary>
1129
public string Arguments { get; set; }
1230

31+
/// <summary>
32+
/// Create an empty <see cref="CustomCommandInfo"/> with an <see cref="ID"/>
33+
/// </summary>
1334
public CustomCommandInfo()
1435
{
1536
ID = Guid.NewGuid();
1637
}
1738

18-
public CustomCommandInfo(Guid id,string name, string filePath)
39+
/// <summary>
40+
/// Create an <see cref="CustomCommandInfo"/> with an <see cref="ID"/>, <see cref="Name"/> and <see cref="FilePath"/>.
41+
/// </summary>
42+
public CustomCommandInfo(Guid id, string name, string filePath)
1943
{
2044
ID = id;
2145
Name = name;
2246
FilePath = filePath;
2347
}
2448

49+
/// <summary>
50+
/// Create an <see cref="CustomCommandInfo"/> with an <see cref="ID"/>, <see cref="Name"/>, <see cref="FilePath"/> and <see cref="Arguments"/>.
51+
/// </summary>
2552
public CustomCommandInfo(Guid id, string name, string filePath, string arguments) : this(id, name, filePath)
2653
{
2754
Arguments = arguments;
2855
}
2956

57+
/// <summary>
58+
/// Method to clone this object.
59+
/// </summary>
3060
public object Clone()
3161
{
3262
return MemberwiseClone();
33-
}
63+
}
3464
}
3565
}

Source/NETworkManager.Utilities/DnsLookupHelper.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ namespace NETworkManager.Utilities
99
{
1010
public class DnsLookupHelper
1111
{
12+
13+
/// <summary>
14+
///
15+
/// </summary>
1216
private static LookupClient DnsLookupClient = new LookupClient();
1317

18+
/// <summary>
19+
///
20+
/// </summary>
1421
public async static Task<string> ResolveHostname(IPAddress ipAddress)
1522
{
1623
string hostname = string.Empty;
@@ -27,6 +34,9 @@ public async static Task<string> ResolveHostname(IPAddress ipAddress)
2734
return hostname;
2835
}
2936

37+
/// <summary>
38+
///
39+
/// </summary>
3040
public async static Task<IPAddress> ResolveIPAddress(string hostname, bool preferIPv4 = true)
3141
{
3242
// Append dns suffix to hostname

0 commit comments

Comments
 (0)