/// <summary> /// Returns a collection of standard values from the default context for the /// data type this type converter is designed for. /// </summary> /// <returns>ConstructionWrapper collection depends on current context</returns> public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { List <ConstructionWrapper> list = new List <ConstructionWrapper>(); // convert property name to ConstructionType ConstructionType constructionType = (ConstructionType)Enum.Parse(typeof(ConstructionType), context.PropertyDescriptor.Name); // convert instance to MEPBuildingConstructionWrapper MEPBuildingConstructionWrapper mEPBuildingConstruction = context.Instance as MEPBuildingConstructionWrapper; // get all Constructions from MEPBuildingConstructionWrapper and add them to a list foreach (Construction con in mEPBuildingConstruction.GetConstructions(constructionType)) { list.Add(new ConstructionWrapper(con)); } // sort the list list.Sort(); return(new StandardValuesCollection(list)); }
/// <summary> /// Get constructions /// </summary> /// <param name="constructionType">ConstructionType</param> /// <returns>Related Constructions specified by constructionTypes</returns> public ICollection <Construction> GetConstructions(ConstructionType constructionType) { return(m_mEPBuildingConstruction.GetConstructions(constructionType)); }
/// <summary> /// Get constructions /// </summary> /// <param name="constructionType">ConstructionType</param> /// <returns>Related Constructions specified by constructionTypes</returns> public ICollection<Construction> GetConstructions(ConstructionType constructionType) { return m_mEPBuildingConstruction.GetConstructions(constructionType); }