Skip to content

Commit

Permalink
Merge pull request #12 from TechieGuy12/dotnet6
Browse files Browse the repository at this point in the history
Update to .Net 6.0
  • Loading branch information
TechieGuy12 authored Jan 24, 2022
2 parents 9d463dd + 192c69b commit 63fb53a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
9 changes: 4 additions & 5 deletions FileWatcher/Configuration/Actions/Action.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using IO = System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using TE.FileWatcher.Logging;
using TE.FileWatcher.FileSystem;
using TEFS = TE.FileWatcher.FileSystem;

namespace TE.FileWatcher.Configuration.Actions
{
Expand Down Expand Up @@ -110,21 +109,21 @@ public override void Run(string watchPath, string fullPath, TriggerType trigger)
switch (Type)
{
case ActionType.Copy:
if (File.IsValid(source))
if (TEFS.File.IsValid(source))
{
File.Copy(source, destination, Verify);
Logger.WriteLine($"Copied {source} to {destination}.");
}
break;
case ActionType.Move:
if (File.IsValid(source))
if (TEFS.File.IsValid(source))
{
File.Move(source, destination, Verify);
Logger.WriteLine($"Moved {source} to {destination}.");
}
break;
case ActionType.Delete:
if (File.IsValid(source))
if (TEFS.File.IsValid(source))
{
File.Delete(source);
Logger.WriteLine($"Deleted {source}.");
Expand Down
8 changes: 4 additions & 4 deletions FileWatcher/Configuration/Notifications/Notifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Notifications
private const int MIN_WAIT_TIME = 30000;

// The timer
private Timer _timer;
private System.Timers.Timer _timer;

/// <summary>
/// Gets or sets the wait time between notification requests.
Expand All @@ -35,14 +35,14 @@ public class Notifications
/// Gets or sets the notifications list.
/// </summary>
[XmlElement("notification")]
public List<Notification> NotificationList { get; set; }
public List<Notification>? NotificationList { get; set; }

/// <summary>
/// Initializes an instance of the <see cref="Notifications"/> class.
/// </summary>
public Notifications()
{
_timer = new Timer(WaitTime);
_timer = new System.Timers.Timer(WaitTime);
_timer.Elapsed += OnElapsed;
_timer.Start();
}
Expand All @@ -56,7 +56,7 @@ public Notifications()
/// <param name="e">
/// The information associated witht he elapsed time.
/// </param>
private async void OnElapsed(object source, ElapsedEventArgs e)
private async void OnElapsed(object? source, ElapsedEventArgs e)
{
// If there are no notifications, then stop the timer
if (NotificationList == null || NotificationList.Count <= 0)
Expand Down
17 changes: 10 additions & 7 deletions FileWatcher/FileWatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>TE.FileWatcher</RootNamespace>
<AssemblyName>fw</AssemblyName>
<Version>1.2.0</Version>
<Version>1.2.1</Version>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
Expand All @@ -14,15 +16,16 @@
<Authors>Paul Salmon</Authors>
<Product>FileWatcher</Product>
<Description>Monitor folders and files on the local system for changes.</Description>
<Copyright2021</Copyright>
<Copyright2022</Copyright>
<RepositoryUrl>https://github.com/TechieGuy12/FileWatcher</RepositoryUrl>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
<AssemblyVersion>1.2.1.0</AssemblyVersion>
<FileVersion>1.2.1.0</FileVersion>
<PackageTags>filesystem file-monitoring folder-monitoring</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21216.1" />
</ItemGroup>

Expand Down

0 comments on commit 63fb53a

Please sign in to comment.