示例#1
0
        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
        public ResourceListView2Column AddColumn(int[] propIds)
        {
            ResourceListView2Column column = new ResourceListView2Column(propIds);

            column.FontCallback      = _itemFormatCache.GetItemFont;
            column.ForeColorCallback = _itemFormatCache.GetItemForeColor;
            column.BackColorCallback = _itemFormatCache.GetItemBackColor;
            _jetListView.Columns.Add(column);
            return(column);
        }
示例#3
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();
            }
        }
示例#4
0
        /**
         * Sets the dialog to the mode for selecting multiple resources.
         */

        public override void SelectResources(string[] resTypes, IResourceList baseList, IResourceList selection)
        {
            _chkColumn = _listView.AddCheckBoxColumn();
            _chkColumn.HandleAllClicks = true;
            _listView.AddIconColumn();
            ResourceListView2Column col = _listView.AddColumn(ResourceProps.DisplayName);

            col.Width    = 20;
            col.AutoSize = true;

            _dataProvider          = new ResourceListDataProvider(baseList);
            _listView.DataProvider = _dataProvider;
            if (selection != null)
            {
                foreach (IResource res in selection)
                {
                    _chkColumn.SetItemCheckState(res, CheckBoxState.Checked);
                }
                if (selection.Count > 0)
                {
                    _listView.Selection.AddIfPresent(selection [0]);
                }
            }
        }