57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
|
|
using Foo.Platform.Win32;
|
|
using System.Runtime.InteropServices;
|
|
using System.Diagnostics;
|
|
|
|
namespace Foo.WorkspaceMgr.Launchers
|
|
{
|
|
internal class Launcher_Generic : ILaunch
|
|
{
|
|
#region ILaunch Members
|
|
|
|
/// <summary>
|
|
/// Checks to see if the file exists in the system i.e. can be reached over
|
|
/// the network. if FileExists fails, we shouldn't be able to launch it.
|
|
/// </summary>
|
|
/// <param name="strArtifactLocation">location of the path + file to launch</param>
|
|
/// <returns></returns>
|
|
public FuncDepBoolType IQueryLaunch(string strArtifactLocation)
|
|
{
|
|
if (!String.IsNullOrEmpty(strArtifactLocation) && (strArtifactLocation.Length > 3))
|
|
{
|
|
if (File.Exists(strArtifactLocation))
|
|
return FuncDepBoolType.Success;
|
|
else
|
|
return FuncDepBoolType.ArtifactLocationUnavailable;
|
|
}
|
|
else
|
|
{
|
|
return FuncDepBoolType.ParametersInvalid;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generic Launcher should be able to handle any file type. Launched the .Net Way.
|
|
/// ~this is the same as if the User clicks on the file.
|
|
/// </summary>
|
|
/// <param name="strArtifactLocation">location of the path + file to launch</param>
|
|
/// <returns></returns>
|
|
public FuncDepBoolType ILaunch(string strArtifactLocation)
|
|
{
|
|
if (!String.IsNullOrEmpty(strArtifactLocation) && (strArtifactLocation.Length > 3))
|
|
{
|
|
Process.Start(strArtifactLocation);
|
|
return FuncDepBoolType.Success;
|
|
}
|
|
return FuncDepBoolType.ParametersInvalid;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|