initial oogynize check in _ this actually used to work!
This commit is contained in:
56
WorkspaceMgr/Launchers/Launcher_Generic.cs
Normal file
56
WorkspaceMgr/Launchers/Launcher_Generic.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user