mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Worked on CreateProjectDialog
This commit is contained in:
@ -21,5 +21,19 @@ namespace RainmeterStudio.Core.Utils
|
||||
foreach (var obj in container)
|
||||
action(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Appends an item at the end of the container
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Enumerable type</typeparam>
|
||||
/// <param name="container">Container</param>
|
||||
/// <param name="item">Item to append</param>
|
||||
public static IEnumerable<T> Append<T> (this IEnumerable<T> container, T item)
|
||||
{
|
||||
foreach (var i in container)
|
||||
yield return i;
|
||||
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
25
RainmeterStudio.Core/Utils/PathHelper.cs
Normal file
25
RainmeterStudio.Core/Utils/PathHelper.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace RainmeterStudio.Core.Utils
|
||||
{
|
||||
public static class PathHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates a path
|
||||
/// </summary>
|
||||
/// <param name="path">The path</param>
|
||||
/// <returns>True if the path is valid</returns>
|
||||
public static bool IsPathValid(string path)
|
||||
{
|
||||
// Check for invalid characters
|
||||
if (Path.GetInvalidPathChars().Intersect(path).Any())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user