|
using System;
using System.IO;
using System.Collections;
namespace AppletEngine
{
/// <summary>
/// The AppletEngine class provides methods for finding and creating AppletLibraries to manage Windows Control Panel Applets
/// </summary>
public class AppletEngine
{
/// <summary>
/// Initializes a new instance of the AppletEngine class
/// </summary>
public AppletEngine()
{
}
/// <summary>
/// Searches the specified path for control panel applet libraries
/// </summary>
/// <param name="path">The path to search</param>
/// <returns>An array of FileInfo objects describing the applet libraries</returns>
public FileInfo[] FindAppletLibraries(string path)
{
DirectoryInfo di = new DirectoryInfo(path);
if (di != null)
{
return di.GetFiles("*.cpl");
}
return new FileInfo[] {};
}
/// <summary>
/// Creates an AppletLibrary for each valid Windows Control Panel Applet described in the FileInfo array
/// </summary>
/// <param name="files">The files to create AppletLibraries from</param>
/// <param name="hWnd">The window handle for the window above which each applet will display it's dialog</param>
/// <returns>An array of AppletLibrary objects containing one or more Applet objects</returns>
public ArrayList CreateApplets(FileInfo[] files, IntPtr hWnd)
{
ArrayList array = new ArrayList();
foreach(FileInfo file in files)
{
try
{
AppletLibrary applet = new AppletLibrary(file.FullName, hWnd);
array.Add(applet);
}
catch(System.Exception systemException)
{
System.Diagnostics.Trace.WriteLine(systemException);
}
}
return array;
}
}
}
|
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.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Senior Application Developer specializing in Windows desktop and network development.
Professional Experience
- B.S. of Computer Science (Graduated 2001 - PSU)
- Senior Application Developer (8+ yrs)
- Microsoft Certified Professional
Primary Interests
- C#, C++, HTML, Javascript
- XML, ASP.NET, Web Services, SOAP, UDDI
- Socket programming and anything network related
- Reflection, Serialization, and Plugin Frameworks
- Owner-drawn controls and GDI+ goodness