예제 #1
0
        private void InitialForm()
        {
            publicMappings  = TableMapping.GetMappingList("ImportPublic");
            privateMappings = TableMapping.GetMappingList("ImportPrivate");

            BindListBox(listBoxPublicCandidates, publicMappings.Where(x => x.Mode == MappingMode.Custom));
            BindListBox(listBoxPrivateCandidates, privateMappings.Where(x => x.Mode == MappingMode.Custom));

            // Load selected columns
            for (int i = 0; i < this.listBoxPublicCandidates.Items.Count; i++)
            {
                var item = (TableMapping)this.listBoxPublicCandidates.Items[i];
                if (this.PublicColumns.Any(x => x.Equals(item.ColName)))
                {
                    this.listBoxPublicCandidates.Items.RemoveAt(i--);
                    this.listBoxPublicSelection.Items.Add(item);
                }
            }
            for (int i = 0; i < this.listBoxPrivateCandidates.Items.Count; i++)
            {
                var item = (TableMapping)this.listBoxPrivateCandidates.Items[i];
                if (this.PrivateColumns.Any(x => x.Equals(item.ColName)))
                {
                    this.listBoxPrivateCandidates.Items.RemoveAt(i--);
                    this.listBoxPrivateSelection.Items.Add(item);
                }
            }
        }
예제 #2
0
        private void InitialForm()
        {
            this.Text = FormTitle;
            mappings  = TableMapping.GetMappingList(MappingTable);
            BindListBox(listBoxCandidates, mappings.Where(x => x.Mode == MappingMode.Custom));

            // Load selected columns
            for (int i = 0; i < this.listBoxCandidates.Items.Count; i++)
            {
                var item = (TableMapping)this.listBoxCandidates.Items[i];
                if (this.Columns.Any(x => x.Id == item.Id))
                {
                    this.listBoxCandidates.Items.RemoveAt(i--);
                    this.listBoxSelection.Items.Add(item);
                }
            }
        }