Example #1
0
 private void  InitializeList()
 {
     _lvResources.AllowColumnReorder = false;
     _lvResources.Columns.Add(new ResourceIconColumn());
     _nameColumn                  = _lvResources.AddColumn(ResourceProps.DisplayName);
     _nameColumn.AutoSize         = true;
     _lvResources.ContextProvider = this;
 }
Example #2
0
        private void  InitializeColumns()
        {
            ResourceListView2Column nameCol;

            _suggestedContacts.Columns.Add(new ResourceIconColumn());
            nameCol          = _suggestedContacts.AddColumn(ResourceProps.DisplayName);
            nameCol.AutoSize = true;

            _contactsToMerge.Columns.Add(new ResourceIconColumn());
            nameCol          = _contactsToMerge.AddColumn(ResourceProps.DisplayName);
            nameCol.AutoSize = true;
        }
Example #3
0
        private void InitListWithAttachments(IResource task)
        {
            _targetList.AllowColumnReorder = false;
            _targetList.Columns.Add(new ResourceIconColumn());
            ResourceListView2Column nameCol = _targetList.AddColumn(ResourceProps.DisplayName);

            nameCol.AutoSize = true;

            IResourceList attaches = task.GetLinksTo(null, TasksPlugin._linkTarget);

            foreach (IResource res in attaches)
            {
                _targetList.JetListView.Nodes.Add(res);
            }
        }
        public OutlookOptionsPane_InfoStores()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            _allStores = Core.ResourceStore.GetAllResources(STR.MAPIInfoStore);
            IResourceList supportedStores   = Core.ResourceStore.FindResourcesWithProp(STR.MAPIInfoStore, PROP.StoreSupported);
            IResourceList unsupportedStores = Core.ResourceStore.GetAllResources(STR.MAPIInfoStore).Minus(supportedStores);

            if (unsupportedStores.Count > 0)
            {
                label1.Text += " Please note that Omea does not support IMAP message stores.";
            }

            _checkBoxColumn = _lvInfoStores.AddCheckBoxColumn();
            _lvInfoStores.AllowColumnReorder = false;
            _lvInfoStores.DataProvider       = new DProvider(_allStores);
            _lvInfoStores.Columns.Add(new ResourceIconColumn());
            ResourceListView2Column nameCol = _lvInfoStores.AddColumn(Core.Props.Name);

            nameCol.AutoSize            = true;
            _checkBoxColumn.AfterCheck += HandleAfterCheck;
        }
Example #5
0
        public void CreateComponents()
        {
            _lblAvailable           = new Label();
            _lblAvailable.Text      = "Available:";
            _lblAvailable.FlatStyle = FlatStyle.System;
            _lblAvailable.AutoSize  = true;

            _lblInWorkspace           = new Label();
            _lblInWorkspace.FlatStyle = FlatStyle.System;
            _lblInWorkspace.AutoSize  = true;

            _lblProcessing           = new Label();
            _lblProcessing.FlatStyle = FlatStyle.System;
            _lblProcessing.AutoSize  = true;
            _lblProcessing.Visible   = false;
            _lblProcessing.Text      = "Processing...";

            _btnAdd    = CreateTabButton("Add", new EventHandler(OnAddListClick));
            _btnRemove = CreateTabButton("Remove", new EventHandler(OnRemoveListClick));

            //
            // _lvAvailable
            //
            _lvAvailable = new ResourceListView2();
            _lvAvailable.Columns.Add(new ResourceIconColumn());
            _lvAvailable.AddColumn(ResourceProps.DisplayName).AutoSize = true;

            IResourceList tabResources = Core.ResourceStore.GetAllResourcesLive(_resourceTypes [0]);

            tabResources.Sort(new int[] { ResourceProps.DisplayName }, true);
            _listAvailable            = tabResources;
            _lvAvailable.DataProvider = new ResourceListDataProvider(_listAvailable);

            _nameJetFilter = new ResourceNameJetFilter("");
            _lvAvailable.Filters.Add(_nameJetFilter);
            _lvAvailable.HeaderStyle              = ColumnHeaderStyle.None;
            _lvAvailable.ShowContextMenu          = false;
            _lvAvailable.ExecuteDoubleClickAction = false;
            _lvAvailable.AllowDrop         = false;
            _lvAvailable.DoubleClick      += new HandledEventHandler(OnAddListClick);
            _lvAvailable.SelectionChanged += new EventHandler(OnListSelectionChanged);

            WorkspaceManager    workspaceManager = Core.WorkspaceManager as WorkspaceManager;
            IResourceNodeFilter filter           = workspaceManager.GetAvailSelectorFilter(_resourceTypes [0]);

            if (filter != null)
            {
                _lvAvailable.Filters.Add(new TreeFilterJetWrapper(filter));
            }

            _edtFind           = new JetTextBox();
            _edtFind.EmptyText = "<type a name to find>";
            _edtFind.IncrementalSearchUpdated += new EventHandler(OnListIncSearch);

            //
            // _lvInWorkspace
            //
            _lvInWorkspace = new ResourceListView2();
            _lvInWorkspace.Columns.Add(new ResourceIconColumn());
            _lvInWorkspace.AddColumn(ResourceProps.DisplayName).AutoSize = true;

            _lvInWorkspace.HeaderStyle              = ColumnHeaderStyle.None;
            _lvInWorkspace.ShowContextMenu          = false;
            _lvInWorkspace.ExecuteDoubleClickAction = false;
            _lvInWorkspace.AllowDrop         = false;
            _lvInWorkspace.DoubleClick      += new HandledEventHandler(OnRemoveListClick);
            _lvInWorkspace.SelectionChanged += new EventHandler(OnListSelectionChanged);

            UpdateListSelection();

            Controls.AddRange(new Control[] { _lblAvailable, _edtFind, _lvAvailable,
                                              _btnAdd, _btnRemove, _lblProcessing,
                                              _lblInWorkspace, _lvInWorkspace });
        }
Example #6
0
        private void RecreateListViewColumns(ResourceListView2 listView, ColumnDescriptor[] columns,
                                             ResourceListDataProvider dataProvider, bool setGroupProviders)
        {
            bool haveTreeColumn = false;

            listView.Columns.BeginUpdate();
            try
            {
                listView.Columns.Clear();
                foreach (ColumnDescriptor desc in columns)
                {
                    int[] propIds = PropNamesToIDs(desc.PropNames, true);
                    ResourcePropsColumn colHdr;

                    if (dataProvider is ConversationDataProvider && !haveTreeColumn &&
                        ((propIds.Length == 1 && propIds [0] == ResourceProps.Type) || (desc.Flags & ColumnDescriptorFlags.FixedSize) == 0))
                    {
                        haveTreeColumn = true;
                        ConversationStructureColumn col = new ConversationStructureColumn(dataProvider as ConversationDataProvider);
                        listView.Columns.Add(col);
                    }

                    if (propIds.Length == 1 && propIds [0] == ResourceProps.Type)
                    {
                        colHdr = listView.AddIconColumn();
                        if (dataProvider is ConversationDataProvider)
                        {
                            colHdr.ShowHeader = false;
                        }
                    }
                    else
                    {
                        ICustomColumn[] customColumns = BuildCustomColumns(propIds);
                        if (customColumns == null)
                        {
                            colHdr      = listView.AddColumn(propIds);
                            colHdr.Text = GetColumnText(propIds);
                            SetPropertyToTextCallbacks(colHdr as ResourceListView2Column);
                            (colHdr as ResourceListView2Column).OwnerList = dataProvider.ResourceList;
                        }
                        else
                        {
                            colHdr = listView.AddCustomColumn(propIds, customColumns);
                        }
                        FillSortMenuText(colHdr, desc, propIds);
                        colHdr.CustomComparer = desc.CustomComparer;
                        colHdr.Alignment      = GetDefaultAlignment(propIds);
                    }

                    if ((desc.Flags & ColumnDescriptorFlags.AutoSize) != 0)
                    {
                        colHdr.AutoSize         = true;
                        colHdr.AutoSizeMinWidth = desc.Width;
                    }
                    else
                    {
                        colHdr.Width = desc.Width;
                        if ((desc.Flags & ColumnDescriptorFlags.FixedSize) != 0)
                        {
                            colHdr.FixedSize = true;
                        }
                    }

                    UpdateGroupProvider(setGroupProviders, desc, colHdr);
                }
            }
            finally
            {
                listView.Columns.EndUpdate();
            }
        }