public static ConcurrentBag <KeyValuePair <RlmInputKey, RlmInputValue> > ParallelWhere(this SortedList <RlmInputKey, RlmInputValue> list,
                                                                                               double from, double to, Enums.RlmInputType type, string val)
        {
            ConcurrentBag <KeyValuePair <RlmInputKey, RlmInputValue> > retVal = new ConcurrentBag <KeyValuePair <RlmInputKey, RlmInputValue> >();

            Parallel.For(0, list.Count, a => {
                if (type == Enums.RlmInputType.Linear ?
                    list.ElementAt(a).Key.DoubleValue >= from &&
                    list.ElementAt(a).Key.DoubleValue <= to :
                    list.ElementAt(a).Key.Value == val)
                {
                    retVal.Add(list.ElementAt(a));
                }
            });

            return(retVal);
        }
Beispiel #2
0
 /// <summary>
 /// object type for input and output settings
 /// </summary>
 /// <param name="name">Sets RlmIO Name property</param>
 /// <param name="dotnettype">Sets rlm_io DotNetType property which assigns the object type in .NET</param>
 /// <param name="min">Sets RlmIO Min property which sets the minimum range value of the input or output</param>
 /// <param name="max">Sets RlmIO Max property which sets the maximum range value of the input or output</param>
 /// <param name="type"></param>
 /// <param name="id">Assigns unique identifier to the input/output</param>
 public RlmIO(String name, String dotnettype, double min, double max, Enums.RlmInputType type, long id = 0)
     : this(name, dotnettype, min, max, id)
 {
     this.Type = type;
 }