public ParameterEditorViewModel(ParameterEditorModel model)
        {
            _model = Arguments.ValidateNotNull(model, "model");

            //Hook up property change events to listen to changes in parameter files
            foreach (var p in _model.Parameters)
            {
                p.PropertyChanged += OnParameterChanged;
            }

            UpdateParameterSets();

            foreach (var p in _model.CommonParameters)
            {
                p.PropertyChanged += OnParameterChanged;
            }
        }
        internal static string GenerateScripArgsFromModel(ParameterEditorModel model)
        {
            Arguments.ValidateNotNull <ParameterEditorModel>(model, "model");
            string scriptArgs = String.Empty;

            foreach (var p in model.Parameters)
            {
                if (p.Value != null)
                {
                    switch (p.Type)
                    {
                    case ParameterType.Boolean:
                        scriptArgs += WrapParameterName(p.Name);
                        scriptArgs += String.Format(" ${0}", p.Value.ToString());
                        break;

                    case ParameterType.Switch:
                        scriptArgs += WrapParameterName(p.Name);
                        scriptArgs += String.Format(":${0}", p.Value.ToString());
                        break;

                    case ParameterType.Byte:
                    case ParameterType.Int32:
                    case ParameterType.Int64:

                    case ParameterType.Float:
                    case ParameterType.Double:
                    case ParameterType.Decimal:

                    case ParameterType.Array:
                    case ParameterType.Unknown:
                        scriptArgs += WrapParameterName(p.Name);
                        scriptArgs += WrapValue(p.Value.ToString());
                        break;

                    case ParameterType.Enum:
                    case ParameterType.Char:
                    case ParameterType.String:
                        scriptArgs += WrapParameterName(p.Name);
                        scriptArgs += p.Value is string?WrapStringValueWithQuotes(p.Value as string) : p.Value;

                        break;
                    }
                }
            }

            foreach (var p in model.CommonParameters)
            {
                if (p.Value != null)
                {
                    switch (p.Type)
                    {
                    case ParameterType.Switch:
                        scriptArgs += WrapParameterName(p.Name);
                        scriptArgs += String.Format(":${0}", p.Value.ToString());
                        break;

                    case ParameterType.Enum:
                        if (!String.IsNullOrEmpty(p.Value as string))
                        {
                            scriptArgs += WrapParameterName(p.Name);
                            scriptArgs += WrapValue(p.Value as string);
                        }
                        break;

                    default:
                        scriptArgs += WrapParameterName(p.Name);
                        scriptArgs += WrapValue(p.Value as string);
                        break;
                    }
                }
            }

            return(scriptArgs);
        }