Пример #1
0
 internal static int GetLength(object obj)
 {
     if (obj is ViStaticArray <T> )
     {
         ViStaticArray <T> array = (ViStaticArray <T>)obj;
         return(array.Length);
     }
     return(0);
 }
Пример #2
0
 public static string Value(this ViStaticArray <ViMiscString> datas, string key)
 {
     for (int idx = 0; idx < datas.Length; ++idx)
     {
         if (String.Compare(datas[idx]._Name, key, true) == 0)
         {
             return(datas[idx]._Value);
         }
     }
     return(string.Empty);
 }
Пример #3
0
 public static Int32 Value(this ViStaticArray <ViMiscInt32> datas, string key, Int32 defaultValue)
 {
     for (int idx = 0; idx < datas.Length; ++idx)
     {
         if (String.Compare(datas[idx]._Name, key, true) == 0)
         {
             return(datas[idx]._Value);
         }
     }
     return(defaultValue);
 }
Пример #4
0
 public static bool GetValue(this ViStaticArray <ViMiscString> datas, string key, ref string value)
 {
     for (int idx = 0; idx < datas.Length; ++idx)
     {
         if (String.Compare(datas[idx]._Name, key, true) == 0)
         {
             value = datas[idx]._Value;
             return(true);
         }
     }
     return(false);
 }
Пример #5
0
 internal static bool SetObject(object obj, int index, object newValue)
 {
     if (obj is ViStaticArray <T> )
     {
         ViStaticArray <T> array = (ViStaticArray <T>)obj;
         if (index < array.Length)
         {
             array[index] = (T)newValue;
             return(true);
         }
     }
     return(false);
 }
Пример #6
0
 internal static object GetObject(object obj, int index)
 {
     if (obj is ViStaticArray <T> )
     {
         ViStaticArray <T> array = (ViStaticArray <T>)obj;
         if (index >= array.Length)
         {
             return(default(T));
         }
         return(array[index]);
     }
     return(default(T));
 }