Пример #1
0
        private void PopulateAttributes(string entityLogicalName, ListViewItem listViewSelectedItem, ServiceParameters serviceParameters)
        {
            if (!workingstate)
            {
                lvAttributes.Items.Clear();
                chkAllAttributes.Checked = true;

                InitFilter(listViewSelectedItem);
                if (listViewSelectedItem != null)
                {
                    using (var bwFill = new BackgroundWorker())
                    {
                        bwFill.DoWork += (sender, e) =>
                        {
                            var unmarkedattributes = Settings[organisationId.ToString()][this.entityLogicalName].UnmarkedAttributes;
                            var controller         = new AttributeController();
                            var attributes         = controller.GetAttributeList(entityLogicalName, cbShowSystemAttributes.Checked, serviceParameters);

                            e.Result = controller.ProcessAllAttributeMetadata(unmarkedattributes, attributes, entityLogicalName, entityAttributes);
                        };
                        bwFill.RunWorkerCompleted += (sender, e) =>
                        {
                            var controller = new ListController();
                            controller.OnPopulateCompletedAction(e, NotificationService, this, lvAttributes);
                            ManageWorkingState(false);
                        };
                        bwFill.RunWorkerAsync();
                    }
                }
            }
        }
        public void ProcessAllAttributeMetadata()
        {
            string        entityLogicalName  = "account_contact";
            List <string> unmarkedattributes = new List <string>();

            var attributeList = new List <AttributeMetadata>()
            {
                new AttributeMetadata
                {
                    LogicalName = "contactattnoentity1",
                    DisplayName = new Label
                    {
                        UserLocalizedLabel = new LocalizedLabel {
                            Label = "Test"
                        }
                    }
                }
            };

            var actual = systemUnderTest.ProcessAllAttributeMetadata(unmarkedattributes, attributeList.ToArray(), entityLogicalName, inputEntityAttributes);

            actual.Count.Should().BeGreaterThan(0);
        }