public static List <Component> GetComponents() { List <Component> list = new List <Component>(); foreach (DataRow row in ((ComponentCache) new ComponentCache().GetData()).dtComponent.Rows) { Component component = new Component(); Component @object = ComponentUtils.GetObject(row); list.Add(@object); } return(list); }
public static Component GetComponent(string componentId) { Component component = null; ComponentCache componentCache = (ComponentCache) new ComponentCache().GetData(); int index = componentCache.dvComponentBy_ComId.Find(componentId); bool flag = index >= 0; if (flag) { Component component2 = new Component(); component = ComponentUtils.GetObject(componentCache.dvComponentBy_ComId[index].Row); } return(component); }