/// <summary>
        /// Updates a ScriptingApplicationArgs.
        /// </summary>
        /// <returns>A ScriptingApplicationArgs type.</returns>
        public ScriptingApplicationArgs UpdateArgumentDefinition(ScriptingApplicationArgs existingApplicationArgs)
        {
            ScriptingApplicationArgs saArguments = new ScriptingApplicationArgs();

            if ( this.WebRequests.Length > 0 )
            {

                Hashtable lookupTable = new Hashtable();
                foreach ( WebRequestArgs wbr in existingApplicationArgs.WebRequestArguments )
                {
                    foreach ( Argument a in wbr.Arguments )
                    {
                        lookupTable.Add(a.Name, a);
                    }
                }

                int i = 0;
                for (int j=0;j<this.WebRequests.Length;j++)
                {
                    WebRequest request = this.WebRequests[j];

                    if ( request.InputTransforms.Length > 0 ||  request.OutputTransforms.Length > 0)
                    {
                        // Create WebRequestArgs, if values are enabled.
                        WebRequestArgs webRequestArgs = new WebRequestArgs();
                        webRequestArgs.WebRequestIndex = j;

                        foreach ( WebTransform t in request.InputTransforms )
                        {
                            Argument[] args = t.GetArguments();

                            if ( args != null )
                            {
                                foreach ( Argument newArgument in args )
                                {
                                    if ( lookupTable.ContainsKey(newArgument.Name) )
                                    {
                                        newArgument.DesignProperty = ((Argument)lookupTable[newArgument.Name]).DesignProperty;
                                    }
                                }
                                webRequestArgs.AddArguments(args);
                            }
                            i++;
                        }

                        i = 0;
                        foreach ( WebTransform t in request.OutputTransforms )
                        {
                            Argument[] args = t.GetArguments();

                            if ( args != null )
                            {
                                foreach ( Argument newArgument in args )
                                {
                                    if ( lookupTable.ContainsKey(newArgument.Name) )
                                    {
                                        newArgument.DesignProperty = ((Argument)lookupTable[newArgument.Name]).DesignProperty;
                                    }
                                }
                                webRequestArgs.AddArguments(args);
                            }
                            i++;
                        }

                        // Add WebRequestArgs to ScriptingApplicationArgs.
                        saArguments.AddWebRequestArgs(webRequestArgs);
                    }
                }
            }

            return saArguments;
        }
        /// <summary>
        /// Creates a ScriptingApplicationArgs.
        /// </summary>
        /// <returns>A ScriptingApplicationArgs type.</returns>
        public ScriptingApplicationArgs CreateArgumentDefinition()
        {
            ScriptingApplicationArgs saArguments = new ScriptingApplicationArgs();

            if ( this.WebRequests.Length > 0 )
            {
                for (int i=0;i<this.WebRequests.Length;i++)
                {
                    WebRequest request = this.WebRequests[i];

                    if ( request.InputTransforms.Length > 0 )
                    {
                        // Create WebRequestArgs, if values are enabled.
                        WebRequestArgs webRequestArgs = new WebRequestArgs();
                        webRequestArgs.WebRequestIndex = i;

                        foreach ( WebTransform t in request.InputTransforms )
                        {
                            Argument[] args = t.GetArguments();

                            if ( args != null )
                            {
                                webRequestArgs.AddArguments(args);
                            }
                        }

                        // Add WebRequestArgs to ScriptingApplicationArgs.
                        saArguments.AddWebRequestArgs(webRequestArgs);
                    }
                }
            }

            return saArguments;
        }