public static void exec(string command, Hash options) { string commandPrompt = UtilityFunctions.env("COMSPEC"); string args = string.Format("/C \"{0}\"", command); exec(commandPrompt, args, options); }
/// <summary> /// Executes nunit against the specified assemblies. /// </summary> /// <param name="assemblyPaths">The assemblies</param> /// <param name="options">Additional options: path (path to unit)</param> public static void nunit(string[] assemblyPaths, Hash options) { string path = options.ObtainAndRemove("path", "lib\\nunit\\nunit-console.exe"); foreach (var assembly in assemblyPaths) { IOFunctions.exec(path, "\"" + assembly + "\""); } }
public static MvcForm BeginForm( this HtmlHelper htmlHelper, String actionName, String controllerName, Hash values ) { return htmlHelper.BeginForm(actionName, controllerName, HashHelper.ToRouteValueDictionary( values )); }
public static MvcForm BeginForm( this HtmlHelper htmlHelper, String actionName, String controllerName, FormMethod method, Hash htmlAttributes ) { return htmlHelper.BeginForm(actionName, controllerName, method, HashHelper.ToStringKeyDictinary( htmlAttributes )); }
/// <summary> /// Executes the specified program with the specified arguments. You can also /// specify the working directory of the command by providing the hash option "WorkingDir" /// </summary> /// <param name="command">The command to execute</param> /// <param name="args">Additional args</param> /// <param name="options">A hash of options to set on the process (like WorkingDir)</param> public static void exec(string command, string args, Hash options) { string workingDir = options.ObtainAndRemove("WorkingDir", "."); var psi = new ProcessStartInfo(command, args) { WorkingDirectory = workingDir, UseShellExecute = false, RedirectStandardError = true }; var process = Process.Start(psi); process.WaitForExit(); }
public static IDictionary<string, object> ToStringKeyDictinary( Hash hash ) { if( hash == null ) return null; var dictionary = new Dictionary<string, object>(); foreach( System.Collections.DictionaryEntry entry in hash ) { dictionary.Add( Convert.ToString( entry.Key ), entry.Value ); } return dictionary; }
public static RouteValueDictionary ToRouteValueDictionary( Hash hash ) { if( hash == null ) return null; var routeValues = new RouteValueDictionary(); foreach( System.Collections.DictionaryEntry entry in hash ) { routeValues.Add( Convert.ToString( entry.Key ), entry.Value ); } return routeValues; }
/// <summary> /// Executes the specified program with the specified arguments. You can also /// specify the working directory of the command by providing the hash option "WorkingDir" /// </summary> /// <param name="command">The command to execute</param> /// <param name="args">Additional args</param> /// <param name="options">A hash of options to set on the process (like WorkingDir)</param> public static void exec(string command, string args, Hash options) { string workingDir = options.ObtainAndRemove("WorkingDir", "."); bool ignoreNonZeroExitCode = options.ObtainAndRemove("IgnoreNonZeroExitCode", false); var psi = new ProcessStartInfo(command, args) { WorkingDirectory = workingDir, UseShellExecute = false, RedirectStandardError = true }; var process = Process.Start(psi); process.WaitForExit(); var exitCode = process.ExitCode; if (exitCode != 0 && ignoreNonZeroExitCode == false) { throw new ExecutionFailedException(exitCode); } }
/// <summary> /// Executes msbuild /// </summary> /// <param name="file">The path to the file to build</param> /// <param name="options">Hash of options</param> public static void msbuild(string file, Hash options) { string frameworkVersion = options.ObtainAndRemove("frameworkVersion", "3.5"); string configuration = options.ObtainAndRemove("configuration", "debug"); string targets = options.ObtainAndRemove("targets", "build"); string verbosity = options.ObtainAndRemove("verbosity", "minimal"); string msbuildDir = UtilityFunctions.env("windir") + "\\microsoft.net\\framework\\v" + frameworkVersion + "\\msbuild.exe"; string args = file + " /p:Configuration=" + configuration + " /t:" + targets + " /v:" + verbosity; foreach (var key in options.Keys) { args += " /p:" + key + "=" + options[key]; } IOFunctions.exec(msbuildDir, args); }
/// <summary> /// Executes the specified program with the specified arguments. You can also /// specify the working directory of the command by providing the hash option "WorkingDir" /// </summary> /// <param name="command"> /// The command to execute /// </param> /// <param name="args">Additional args</param> /// <param name="options"> /// A hash of options to set on the process (like WorkingDir) /// </param> public static void exec(string command, string args, Hash options) { Exec exec = new Exec(); exec.ExeName = command; exec.Output = (options.ContainsKey("Output")) ? new FileInfo(options.ObtainAndRemove("Output", "")) : null; exec.Execute(args, options); //string workingDir = options.ObtainAndRemove("WorkingDir", "."); //bool ignoreNonZeroExitCode = options.ObtainAndRemove("IgnoreNonZeroExitCode", false); //var psi = new ProcessStartInfo(command, args) { // WorkingDirectory = workingDir, // UseShellExecute = false, // RedirectStandardError = true //}; //var process = Process.Start(psi); //process.WaitForExit(); //var exitCode = process.ExitCode; //if (exitCode != 0 && ignoreNonZeroExitCode == false) { // var errortext = process.StandardError.ReadAllAsString(); // throw new ExecutionFailedException(exitCode, errortext); //} }
public static MvcHtmlString ValidationSummary(this HtmlHelper htmlHelper, Hash htmlAttributes) { return htmlHelper.ValidationSummary("Validation errors occured.", HashHelper.ToStringKeyDictinary(htmlAttributes)); }
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, Hash routeValues, Hash htmlAttributes) { return htmlHelper.RouteLink( linkText, routeName, protocol, hostName, fragment, HashHelper.ToRouteValueDictionary( routeValues ), HashHelper.ToRouteValueDictionary( htmlAttributes ) ); }
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, Hash routeValues) { return htmlHelper.RouteLink( linkText, HashHelper.ToRouteValueDictionary( routeValues ) ); }
public static MvcHtmlString ListBox(this HtmlHelper htmlHelper, string name, IEnumerable<SelectListItem> selectList, Hash htmlAttributes) { return htmlHelper.ListBox( name, selectList, HashHelper.ToStringKeyDictinary( htmlAttributes ) ); }
public static MvcHtmlString DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable<SelectListItem> selectList, string optionLabel, Hash htmlAttributes) { return htmlHelper.DropDownList( name, selectList, optionLabel, HashHelper.ToStringKeyDictinary( htmlAttributes ) ); }
public CompilerContext(CompilerParameters options, CompileUnit unit) { if (null == options) throw new ArgumentNullException("options"); if (null == unit) throw new ArgumentNullException("unit"); _unit = unit; _errors = new CompilerErrorCollection(); _warnings = new CompilerWarningCollection(); _assemblyReferences = options.References; _parameters = options; if (_parameters.Debug && !_parameters.Defines.ContainsKey("DEBUG")) _parameters.Defines.Add("DEBUG", null); _nameResolutionService = new TypeSystem.NameResolutionService(this); _properties = new Hash(); }
public ForeignReferenceCollector() { _references = new List(); _recursiveReferences = new List(); _referencedEntities = new Hash(); }
public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, String name, String value, Int32 rows, Int32 columns, Hash htmlAttributes) { return htmlHelper.TextArea(name, value, rows, columns, HashHelper.ToStringKeyDictinary( htmlAttributes )); }
public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, String name, Hash htmlAttributes) { return htmlHelper.TextArea(name, HashHelper.ToStringKeyDictinary( htmlAttributes )); }
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, Hash routeValues) { return htmlHelper.ActionLink( linkText, actionName, HashHelper.ToRouteValueDictionary( routeValues ) ); }
public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, Hash routeValues, Hash htmlAttributes) { return htmlHelper.ActionLink( linkText, actionName, controllerName, protocol, hostName, fragment, HashHelper.ToRouteValueDictionary( routeValues ), HashHelper.ToRouteValueDictionary( htmlAttributes ) ); }
public String Action( String actionName, String controllerName, Hash valuesDictionary ) { return Action( actionName, controllerName, HashHelper.ToRouteValueDictionary( valuesDictionary ) ); }
public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, Hash routeValues, Hash htmlAttributes) { return htmlHelper.RouteLink( linkText, routeName, HashHelper.ToRouteValueDictionary( routeValues ), HashHelper.ToRouteValueDictionary( htmlAttributes ) ); }
public String Action( String actionName, String controllerName, Hash valuesDictionary, String protocol, String hostName ) { return Action( actionName, controllerName, HashHelper.ToRouteValueDictionary( valuesDictionary ), protocol, hostName ); }
public static MvcForm BeginForm( this HtmlHelper htmlHelper, Hash values ) { return htmlHelper.BeginForm(HashHelper.ToRouteValueDictionary( values )); }
public static MvcHtmlString TextBox(this HtmlHelper htmlHelper, String name, Object value, Hash htmlAttributes) { return htmlHelper.TextBox(name, value, HashHelper.ToStringKeyDictinary( htmlAttributes )); }
public String RouteUrl( String routeName, Hash valuesDictionary, String protocol, String hostName ) { return RouteUrl( routeName, HashHelper.ToRouteValueDictionary( valuesDictionary ), protocol, hostName ); }
public static MvcHtmlString ValidationMessage(this HtmlHelper htmlHelper, String modelName, String validationMessage, Hash htmlAttributes) { return htmlHelper.ValidationMessage(modelName, validationMessage, HashHelper.ToStringKeyDictinary( htmlAttributes )); }
public String RouteUrl( String routeName, Hash valuesDictionary ) { return RouteUrl( routeName, HashHelper.ToRouteValueDictionary( valuesDictionary ) ); }
public static MvcHtmlString RadioButton(this HtmlHelper htmlHelper, String name, Object value, Boolean isChecked, Hash htmlAttributes) { return htmlHelper.RadioButton(name, value, isChecked, HashHelper.ToStringKeyDictinary( htmlAttributes )); }