示例#1
0
        internal static void InitializeAttribute(TDMSAttributes attributes, string name, string value)
        {
            var attr = attributes.FirstOrDefault(a => a.AttributeDefName.Equals(name));

            try {
                if (attr != null)
                {
                    attr.Value = value;
                }
            }
            catch (Exception) {
                LogManager.GetLogger("TdmsContext.InitializeAttribute").Debug($"Error. attName: {name}, value: {value}");
            }
        }
 /// <summary>
 /// Invokes TdmsAttribute from TDMSAttributes collection by name
 /// </summary>
 /// <param name="attributes">source TDMSAttributes collection</param>
 /// <param name="name">goal AttributeDefName to be found</param>
 /// <returns></returns>
 public static TDMSAttribute GetAttribute(TDMSAttributes attributes, string name)
 {
     return(attributes.FirstOrDefault(attr => attr.AttributeDefName.Equals(name)));
 }