Worked on CreateProjectDialog

This commit is contained in:
2014-08-16 11:05:26 +03:00
parent 5dc71eca92
commit c933b96347
9 changed files with 185 additions and 52 deletions

View File

@ -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;
}
}
}

View 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;
}
}
}