private AutoCompleteStringCollection LoadAutoCompleteConcerns()
        {
            _concernMap = new Dictionary <string, string>();
            var collection = new AutoCompleteStringCollection();
            var concerns   = (from x in EAMain.Repository.GetAllElements() where EAMain.IsConcern(x) select x);

            foreach (var concern in concerns)
            {
                if (!_concernMap.ContainsKey(concern.Name))
                {
                    _concernMap.Add(concern.Name, concern.GUID);
                    collection.Add(concern.Name);
                }
            }
            return(collection);
        }
Example #2
0
        /// <summary>
        ///     Populates the listbox with the concerns from the repository
        /// </summary>
        private void PopulateConcerns()
        {
            IEARepository repository = EAMain.Repository;

            Dictionary <string, string> concerns =
                repository.GetAllElements()
                .Where(element => element != null && EAMain.IsConcern(element))
                .ToDictionary(element => element.GUID,
                              element => element.Name + " (" + element.ParentPackage.Name + ")");

            if (concerns.Count <= 0) //No concerns found
            {
                _btnAddForce.Enabled = false;
                return;
            }
            _lbConcern.DataSource    = new BindingSource(concerns, null);
            _lbConcern.DisplayMember = "Value";
            _lbConcern.ValueMember   = "Key";
        }