Exemple #1
0
        private static string FormatParameter(ParameterModel parameter, bool hash)
        {
            var type  = parameter.Type;
            var name  = parameter.Name;
            var value = parameter.Value;

            switch (type)
            {
            case ParameterType.Unsupported:
            case ParameterType.Float:
            case ParameterType.Double:
            case ParameterType.Decimal:
            case ParameterType.Char:
            case ParameterType.Enum:
            case ParameterType.Byte:
            case ParameterType.Int32:
            case ParameterType.Int64:
            case ParameterType.String:
            case ParameterType.Choice:
                return(FormatString(name, value, hash));

            case ParameterType.Boolean:
                return(FormatBool(name, value, hash));

            case ParameterType.Switch:
                return(FormatSwitch(name, value, hash));

            case ParameterType.Array:
                return(FormatArray(name, value, hash));

            default:
                return(string.Empty);
            }
        }
Exemple #2
0
        private void OnParameterPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Value")
            {
                ParameterModel model = sender as ParameterModel;
                foreach (ParameterModel parameter in _parameters)
                {
                    if (parameter.Name == model.Name)
                    {
                        parameter.Value = model.Value;
                    }
                }

                RaisePropertyChanged("Parameters");
            }
        }