コード例 #1
0
ファイル: CorrespondentCtrl.cs プロジェクト: mo5h/omeo
        public override void Populate()
        {
            AddressBook.Initialize();

            _cmbCategory.BeginUpdate();
            try
            {
                _cmbCategory.Items.Clear();
                LoadViews();
                LoadAddressBooks();
                LoadCategories();
            }
            finally
            {
                _cmbCategory.EndUpdate();
            }

            AttachResourceWatchHandlers();

            _listContacts.Columns.Add(new ResourceIconColumn());
            ResourceListView2Column nameCol = _listContacts.AddColumn(ResourceProps.DisplayName);

            nameCol.SizeToContent           = true;
            _listContacts.SelectionChanged += OnNewQuerySelected;

            SetComboSelection();
        }
コード例 #2
0
        /// <summary>
        /// Sets the dialog to the mode for selecting a single resource.
        /// </summary>
        public override void SelectResource(string[] resTypes, IResourceList baseList, IResource selection)
        {
            _listView.AddIconColumn();
            ResourceListView2Column col = _listView.AddColumn(ResourceProps.DisplayName);

            col.Width              = 20;
            col.AutoSize           = true;
            _listView.MultiSelect  = false;
            _dataProvider          = new ResourceListDataProvider(baseList);
            _listView.DataProvider = _dataProvider;
            bool haveSelection = false;

            if (selection != null)
            {
                haveSelection = _listView.Selection.AddIfPresent(selection);
            }
            if (!haveSelection)
            {
                _listView.Selection.MoveDown();
            }
        }