|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Threading;
namespace ItnuesPlayListManager
{
public static class InteractionUtils
{
/// <summary>
/// Returns a string array of specifed filesystem path elemets starting with drive letter and ending
/// </summary>
/// <param name="path">A valid file path</param>
/// <returns>array of path elements starting with drive letter and ending with file name with extention</returns>
public static List<string> GetBrokenPaths(string path)
{
List<string> list = new List<string>();
string[] str = path.Split(new char[] { '\\', ':' }, 999, StringSplitOptions.RemoveEmptyEntries);
list.AddRange(str.AsEnumerable());
return list;
}
/// <summary>
/// This Extention is used to do some operations which is in another thread.
/// </summary>
/// <param name="control"></param>
/// <param name="operation">lambada expression or Action reference to the method</param>
/// <example>
/// lstOutput.InvokeIfRequired(() => { lstOutput.Items.Add(e.Message); });
/// </example>
public static void RemoteThreadUpdate(this Dispatcher ctrlControl, Action mtdLambadaExpression)
{
if (ctrlControl.CheckAccess())
{
mtdLambadaExpression();
}
else
{
ctrlControl.BeginInvoke(DispatcherPriority.Normal, mtdLambadaExpression);
}
}
}
/// <summary>
/// A generic Dataevent Argument
/// </summary>
/// <typeparam name="T"></typeparam>
public class DataEventArgs<T> : EventArgs
{
public DataEventArgs(T data)
{
this.Data = data;
}
public T Data { get; set; }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Started Programming career with VB 6 and VC++ and now Into .Net Development. Working with .Net since its first release (Version 1.0 Beta). Lucky enough to continue always with most updated versions of .Net and as of now; May 2007, fighting with .Net 3.0 (WPF,WCF...etc) and it's next most anticipated version LINQ.
Got familiarity up on the .Net Technologies and Guidelines like CAB, and Patterns and Practices, Enterprise Library and now with it's WPF version etc.
Specialized in Windows and Distributed and Service oriented applications.