コード例 #1
0
        public void CmbBeanTest02()
        {
            Label label = new Label();
            CmbBean cls = new CmbBean("logicalName", label);

            Assert.AreEqual("logicalName", cls.LogicalName);
            Assert.AreEqual("logicalName", cls.DisplayName);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }