mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Changed the discord bot to be case insensitive.
Added IsEmpty and HasOne IEnumerable Extensions.
This commit is contained in:
parent
734332f10c
commit
dd431e93b2
20 changed files with 383 additions and 107 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.Win32.TaskScheduler;
|
||||
using NLog;
|
||||
using ServerManagerTool.Common.Extensions;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
|
@ -202,7 +203,7 @@ namespace ServerManagerTool.Common.Utils
|
|||
|
||||
// Add/Edit the trigger that will fire every x minutes
|
||||
var triggers = taskDefinition.Triggers.OfType<TimeTrigger>();
|
||||
if (triggers.Count() == 0)
|
||||
if (triggers.IsEmpty())
|
||||
{
|
||||
var trigger = new TimeTrigger
|
||||
{
|
||||
|
|
@ -445,7 +446,7 @@ namespace ServerManagerTool.Common.Utils
|
|||
if (onBoot)
|
||||
{
|
||||
var triggers = taskDefinition.Triggers.OfType<BootTrigger>();
|
||||
if (triggers.Count() == 0)
|
||||
if (triggers.IsEmpty())
|
||||
{
|
||||
var trigger = new BootTrigger
|
||||
{
|
||||
|
|
@ -465,7 +466,7 @@ namespace ServerManagerTool.Common.Utils
|
|||
else
|
||||
{
|
||||
var triggers = taskDefinition.Triggers.OfType<LogonTrigger>();
|
||||
if (triggers.Count() == 0)
|
||||
if (triggers.IsEmpty())
|
||||
{
|
||||
var trigger = new LogonTrigger
|
||||
{
|
||||
|
|
@ -572,7 +573,7 @@ namespace ServerManagerTool.Common.Utils
|
|||
|
||||
// Add/Edit the trigger that will fire every x minutes
|
||||
var triggers = taskDefinition.Triggers.OfType<TimeTrigger>();
|
||||
if (triggers.Count() == 0)
|
||||
if (triggers.IsEmpty())
|
||||
{
|
||||
var trigger = new TimeTrigger
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Ionic.Zip;
|
||||
using ServerManagerTool.Common.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
@ -73,7 +74,8 @@ namespace ServerManagerTool.Common.Utils
|
|||
{
|
||||
if (string.IsNullOrWhiteSpace(zipFile))
|
||||
throw new ArgumentNullException(nameof(zipFile));
|
||||
if (!filesToZip.Any())
|
||||
|
||||
if (filesToZip is null || filesToZip.IsEmpty())
|
||||
return;
|
||||
|
||||
if (!File.Exists(zipFile))
|
||||
|
|
@ -165,7 +167,8 @@ namespace ServerManagerTool.Common.Utils
|
|||
{
|
||||
if (string.IsNullOrWhiteSpace(zipFile))
|
||||
throw new ArgumentNullException(nameof(zipFile));
|
||||
if (!filesToZip.Any())
|
||||
|
||||
if (filesToZip is null || filesToZip.IsEmpty())
|
||||
throw new ArgumentNullException(nameof(filesToZip));
|
||||
|
||||
using (var zip = new ZipFile(zipFile))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue