using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.Academy._50L { public static class ExtendMethod { public static T GetValue(this FeedbackData fbd) { if (PlcControl.GetInstance.Data.ContainsKey(fbd)) { try { return (T)Convert.ChangeType(PlcControl.GetInstance.Data[fbd], typeof(T)); } catch (Exception e) { return default(T); } } else { return default(T); } } } }