public void CmbBeanTest02() { Label label = new Label(); CmbBean cls = new CmbBean("logicalName", label); Assert.AreEqual("logicalName", cls.LogicalName); Assert.AreEqual("logicalName", cls.DisplayName); }
public void CmbBeanTest01() { Label label = new Label(); label.UserLocalizedLabel = new LocalizedLabel("ラベル", LANG_CODE); CmbBean cls = new CmbBean("logicalName", label); Assert.AreEqual("logicalName", cls.LogicalName); Assert.AreEqual("ラベル(logicalName)", cls.DisplayName); }
/// <summary> /// 条件指定用のコンボボックスを設定 /// </summary> /// <param name="attributes"></param> /// <returns></returns> public void SetAttributeCmb(AttributeMetadata[] attributes, ComboBox cmb) { List<CmbBean> attributeList = new List<CmbBean>(); foreach (AttributeMetadata attr in attributes) { CmbBean bean = new CmbBean(attr.LogicalName, attr.DisplayName); attributeList.Add(bean); } attributeList.Sort((a, b) => a.DisplayName.CompareTo(b.DisplayName)); SetListToCmb(attributeList, cmb); }
/// <summary> /// エンティティ指定用のコンボボックスDataSource生成 /// </summary> /// <param name="entities"></param> /// <returns></returns> public void SetEntityCmb(EntityMetadata[] entities, ComboBox cmb) { List<CmbBean> entityList = new List<CmbBean>(); foreach (EntityMetadata entity in entities) { if (!entity.IsCustomizable.Value) { // Internal entitiesをMultipleRetrieveができないが、 // とりあえずカスタマイズ不可なものを除く // https://msdn.microsoft.com/en-us/library/gg328086.aspx continue; } CmbBean bean = new CmbBean(entity.LogicalName, entity.DisplayName); entityList.Add(bean); } entityList.Sort((a, b) => a.DisplayName.CompareTo(b.DisplayName)); SetListToCmb(entityList, cmb); }