Пример #1
0
        /// <summary>
        /// Mencari index variabel pada list
        /// </summary>
        /// <param name="variableCollection">list variabel</param>
        /// <param name="name">nama variabel</param>
        /// <returns>index</returns>
        public static int FindVariableIndex(SeriesVariables variableCollection, string name)
        {
            variableToFind = new SeriesVariable(name, "");
            System.Predicate<SeriesVariable> search = findVariablePredicate;

            return variableCollection.FindIndex(search);
        }
Пример #2
0
 /// <summary>
 /// Predicate untuk pencarian variabel
 /// </summary>
 /// <param name="search">variabel yang akan dicari</param>
 /// <returns>apakah nama variabel match</returns>
 private static bool findVariablePredicate(SeriesVariable search)
 {
     return search.VariableName.Equals(variableToFind.VariableName);
 }
Пример #3
0
        /// <summary>
        /// Mengkloning variabel
        /// </summary>
        /// <returns>variabel baru dengan nilai sama dengan variabel asal</returns>
        public object Clone()
        {
            SeriesVariable clone = new SeriesVariable(this.VariableName, this.VariableDescription, this.SeriesValues.Count);

            for (int i = 0; i < this.SeriesValues.Count; i++)
            {
                clone[i] = this[i];
            }

            return clone;
        }