Exemple #1
0
        private void RefreshAttributes()
        {
            cmbAttribute.Items.Clear();
            var entityNode = cmbEntity.SelectedItem is EntityNode ? (EntityNode)cmbEntity.SelectedItem : null;

            if (entityNode == null)
            {
                entityNode = new EntityNode(GetClosestEntityNode(node));
            }
            if (entityNode == null)
            {
                return;
            }
            var entityName = entityNode.EntityName;

            if (form.NeedToLoadEntity(entityName))
            {
                if (!form.working)
                {
                    form.LoadEntityDetails(entityName, RefreshAttributes);
                }
                return;
            }
            var attributes = form.GetDisplayAttributes(entityName);

            foreach (var attribute in attributes)
            {
                AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, true, FetchXmlBuilder.friendlyNames);
            }
            // RefreshFill now that attributes are loaded
            ControlUtils.FillControl(collec, cmbAttribute);
            ControlUtils.FillControl(collec, cmbValue);
        }
        private void RefreshAttributes()
        {
            if (!IsInitialized)
            {
                return;
            }
            cmbAttribute.Items.Clear();
            var entityNode = cmbEntity.SelectedItem is EntityNode ? (EntityNode)cmbEntity.SelectedItem : null;

            if (entityNode == null)
            {
                entityNode = new EntityNode(GetClosestEntityNode(Node));
            }
            if (entityNode == null)
            {
                return;
            }
            var entityName = entityNode.EntityName;

            if (fxb.NeedToLoadEntity(entityName))
            {
                if (!fxb.working)
                {
                    fxb.LoadEntityDetails(entityName, RefreshAttributes);
                }
                return;
            }
            BeginInit();
            var attributes = fxb.GetDisplayAttributes(entityName);

            attributes.ToList().ForEach(a => AttributeItem.AddAttributeToComboBox(cmbAttribute, a, true, FetchXmlBuilder.friendlyNames));
            // RefreshFill now that attributes are loaded
            ReFillControl(cmbAttribute);
            ReFillControl(cmbValue);
            EndInit();
            RefreshOperators();
            UpdateValueField();
            RefreshValueOf();
            NormalizeLike();
        }
 private void RefreshAttributes()
 {
     cmbAttribute.Items.Clear();
     var entityNode = cmbEntity.SelectedItem is EntityNode ? (EntityNode)cmbEntity.SelectedItem : null;
     if (entityNode == null)
     {
         entityNode = new EntityNode(GetClosestEntityNode(node));
     }
     if (entityNode == null)
     {
         return;
     }
     var entityName = entityNode.EntityName;
     if (form.NeedToLoadEntity(entityName))
     {
         if (!form.working)
         {
             form.LoadEntityDetails(entityName, RefreshAttributes);
         }
         return;
     }
     var entities = FetchXmlBuilder.GetDisplayEntities();
     var attributes = FetchXmlBuilder.GetDisplayAttributes(entityName);
     foreach (var attribute in attributes)
     {
         AttributeItem.AddAttributeToComboBox(cmbAttribute, attribute, true);
     }
     // RefreshFill now that attributes are loaded
     ControlUtils.FillControl(collec, cmbAttribute);
     ControlUtils.FillControl(collec, cmbValue);
 }