상속: System.Collections.Hashtable
예제 #1
0
        public static void exec(string command, Hash options)
        {
            string commandPrompt = UtilityFunctions.env("COMSPEC");
            string args = string.Format("/C \"{0}\"", command);

            exec(commandPrompt, args, options);
        }
예제 #2
0
 /// <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 + "\"");
     }
 }
예제 #3
0
 public static MvcForm BeginForm( this HtmlHelper htmlHelper,
                                  String actionName,
                                  String controllerName,
                                  Hash values )
 {
     return htmlHelper.BeginForm(actionName, controllerName, HashHelper.ToRouteValueDictionary( values ));
 }
예제 #4
0
 public static MvcForm BeginForm( this HtmlHelper htmlHelper,
                                  String actionName,
                                  String controllerName,
                                  FormMethod method,
                                  Hash htmlAttributes )
 {
     return htmlHelper.BeginForm(actionName, controllerName, method, HashHelper.ToStringKeyDictinary( htmlAttributes ));
 }
예제 #5
0
 /// <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();
 }
예제 #6
0
        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;
        }
예제 #7
0
        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;
        }
예제 #8
0
        /// <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);
            }
        }
예제 #9
0
        /// <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);
        }
예제 #10
0
        /// <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);
            //}
        }
예제 #11
0
 public static MvcHtmlString ValidationSummary(this HtmlHelper htmlHelper, Hash htmlAttributes)
 {
     return htmlHelper.ValidationSummary("Validation errors occured.", HashHelper.ToStringKeyDictinary(htmlAttributes));
 }
예제 #12
0
 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 ) );
 }
예제 #13
0
 public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, Hash routeValues)
 {
     return htmlHelper.RouteLink( linkText, HashHelper.ToRouteValueDictionary( routeValues ) );
 }
예제 #14
0
 public static MvcHtmlString ListBox(this HtmlHelper htmlHelper, string name, IEnumerable<SelectListItem> selectList, Hash htmlAttributes)
 {
     return htmlHelper.ListBox( name, selectList, HashHelper.ToStringKeyDictinary( htmlAttributes ) );
 }
예제 #15
0
 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 ) );
 }
예제 #16
0
        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();
        }
예제 #17
0
 public ForeignReferenceCollector()
 {
     _references = new List();
     _recursiveReferences = new List();
     _referencedEntities = new Hash();
 }
예제 #18
0
 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 ));
 }
예제 #19
0
 public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, String name, Hash htmlAttributes)
 {
     return htmlHelper.TextArea(name, HashHelper.ToStringKeyDictinary( htmlAttributes ));
 }
예제 #20
0
 public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, Hash routeValues)
 {
     return htmlHelper.ActionLink( linkText, actionName, HashHelper.ToRouteValueDictionary( routeValues ) );
 }
예제 #21
0
 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 ) );
 }
예제 #22
0
 public String Action( String actionName, String controllerName, Hash valuesDictionary )
 {
     return Action( actionName, controllerName, HashHelper.ToRouteValueDictionary( valuesDictionary ) );
 }
예제 #23
0
 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 ) );
 }
예제 #24
0
 public String Action( String actionName, String controllerName, Hash valuesDictionary, String protocol, String hostName )
 {
     return Action( actionName, controllerName, HashHelper.ToRouteValueDictionary( valuesDictionary ), protocol, hostName );
 }
예제 #25
0
 public static MvcForm BeginForm( this HtmlHelper htmlHelper, Hash values )
 {
     return htmlHelper.BeginForm(HashHelper.ToRouteValueDictionary( values ));
 }
예제 #26
0
 public static MvcHtmlString TextBox(this HtmlHelper htmlHelper, String name, Object value, Hash htmlAttributes)
 {
     return htmlHelper.TextBox(name, value, HashHelper.ToStringKeyDictinary( htmlAttributes ));
 }
예제 #27
0
 public String RouteUrl( String routeName, Hash valuesDictionary, String protocol, String hostName )
 {
     return RouteUrl( routeName, HashHelper.ToRouteValueDictionary( valuesDictionary ), protocol, hostName );
 }
예제 #28
0
 public static MvcHtmlString ValidationMessage(this HtmlHelper htmlHelper, String modelName, String validationMessage, Hash htmlAttributes)
 {
     return htmlHelper.ValidationMessage(modelName, validationMessage, HashHelper.ToStringKeyDictinary( htmlAttributes ));
 }
예제 #29
0
 public String RouteUrl( String routeName, Hash valuesDictionary )
 {
     return RouteUrl( routeName, HashHelper.ToRouteValueDictionary( valuesDictionary ) );
 }
예제 #30
0
 public static MvcHtmlString RadioButton(this HtmlHelper htmlHelper, String name, Object value, Boolean isChecked, Hash htmlAttributes)
 {
     return htmlHelper.RadioButton(name, value, isChecked, HashHelper.ToStringKeyDictinary( htmlAttributes ));
 }