Beispiel #1
0
        public ParameterStack GetParameters(IComponentSearchMethod compSearchMethod)
        {
            ParameterStack parameters = Plugin.Parameters;
            string         grpId      = string.Empty;

            if (null != compSearchMethod)
            {
                foreach (Parameter p in parameters)
                {
                    try
                    {
                        if (p is ParameterAngle pa)
                        {
                            parameters.SetAngleParameter(pa.Name, compSearchMethod.GetAngleParameterDefaultValue(grpId, Guid, pa.Name));
                        }
                        if (p is ParameterDouble pd)
                        {
                            parameters.SetDoubleParameter(pd.Name, compSearchMethod.GetDoubleParameterDefaultValue(grpId, Guid, pd.Name));
                        }
                        if (p is ParameterBool pb)
                        {
                            parameters.SetBoolParameter(pb.Name, compSearchMethod.GetBoolParameterDefaultValue(grpId, Guid, pb.Name));
                        }
                        if (p is ParameterInt pi)
                        {
                            parameters.SetIntegerParameter(pi.Name, compSearchMethod.GetIntParameterDefaultValue(grpId, Guid, pi.Name));
                        }
                        if (p is ParameterMulti pm)
                        {
                            parameters.SetMultiParameter(pm.Name, 0);
                        }
                    }
                    catch (Exception /*ex*/)
                    {
                    }
                }
            }
            return(parameters);
        }
Beispiel #2
0
        public ParameterStack GetParameters(IComponentSearchMethod compSearchMethod)
        {
            ParameterStack parameters = _instance.Parameters;

            if (null != compSearchMethod)
            {
                foreach (Parameter p in parameters)
                {
                    try
                    {
                        ParameterDouble pd = p as ParameterDouble;
                        if (null != pd)
                        {
                            parameters.SetDoubleParameter(pd.Name, compSearchMethod.GetDoubleParameterDefaultValue(Guid, pd.Name));
                        }
                        ParameterBool pb = p as ParameterBool;
                        if (null != pb)
                        {
                            parameters.SetBoolParameter(pb.Name, compSearchMethod.GetBoolParameterDefaultValue(Guid, pb.Name));
                        }
                        ParameterInt pi = p as ParameterInt;
                        if (null != pi)
                        {
                            parameters.SetIntegerParameter(pb.Name, compSearchMethod.GetIntParameterDefaultValue(Guid, pi.Name));
                        }
                        ParameterMulti pm = p as ParameterMulti;
                        if (null != pm)
                        {
                            parameters.SetMultiParameter(pm.Name, 0);
                        }
                    }
                    catch (Exception /*ex*/)
                    {
                    }
                }
            }
            return(parameters);
        }