Ejemplo n.º 1
0
        private SelectionList <T> GetSelectionListForScope(string scope)
        {
            lock (_lockObject)
            {
                if (scope is null)
                {
                    if (_noScopeSelections is null)
                    {
                        _noScopeSelections = CreateSelectionList(null);
                    }

                    return(_noScopeSelections);
                }
                else
                {
                    if (!_selectionsByScope.TryGetValue(scope, out var selections))
                    {
                        selections = CreateSelectionList(scope);

                        _selectionsByScope[scope] = selections;
                    }

                    return(selections);
                }
            }
        }
Ejemplo n.º 2
0
        private SelectionList <T> CreateSelectionList(string scope)
        {
            var selectionList = new SelectionList <T>(scope)
            {
                AllowMultiSelect = AllowMultiSelect
            };

            selectionList.SelectionChanged += OnSelectionListSelectionChanged;

            return(selectionList);
        }