Exemplo n.º 1
0
 private void btnSelAll_Click(object sender, EventArgs e)
 {
     foreach (JetListViewNode node in _searchEngines.Nodes)
     {
         _checkColumn.SetItemCheckState(node.Data, CheckBoxState.Checked);
     }
     NextPredicate(IsValidForm());
 }
Exemplo n.º 2
0
 private void SetColumnFromFlag(PropertyTypeTag tag, CheckBoxColumn column, ColumnDescriptorFlags flag, bool isChecked)
 {
     if (isChecked)
     {
         column.SetItemCheckState(tag,
                                  ((tag.ColDesc.Flags & flag) != 0)
             ? CheckBoxState.Checked
             : CheckBoxState.Unchecked);
     }
     else
     {
         column.SetItemCheckState(tag, CheckBoxState.Grayed);
     }
 }
Exemplo n.º 3
0
 public override void ShowPane()
 {
     foreach (IResource store in _allStores)
     {
         if (!store.HasProp(PROP.IgnoredFolder) && store.HasProp(PROP.StoreSupported))
         {
             _checkBoxColumn.SetItemCheckState(store, CheckBoxState.Checked);
         }
         else
         if (!store.HasProp(PROP.StoreSupported))
         {
             _checkBoxColumn.SetItemCheckState(store, CheckBoxState.Grayed);
         }
     }
 }
Exemplo n.º 4
0
 public void ShowResults(RSSDiscover discover)
 {
     _haveAvailableResults = false;
     _resultList.Nodes.Clear();
     foreach (RSSDiscover.RSSDiscoverResult result in discover.Results)
     {
         _resultList.Nodes.Add(result);
         if (result.ExistingFeed != null)
         {
             _checkColumn.SetItemCheckState(result, CheckBoxState.Grayed);
         }
         else
         {
             if (!_haveAvailableResults)
             {
                 _checkColumn.SetItemCheckState(result, CheckBoxState.Checked);
             }
             _haveAvailableResults = true;
         }
     }
     NextPredicate(_haveAvailableResults);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Restores the checked state of resources after a different category
 /// has been selected.
 /// </summary>
 private void UpdateCheckedResources()
 {
     _updatingCheckedResources = true;
     try
     {
         foreach (int id in _checkedResources)
         {
             IResource res = Core.ResourceStore.TryLoadResource(id);
             if (res != null & _listContacts.JetListView.NodeCollection.Contains(res))
             {
                 _checkBoxColumn.SetItemCheckState(res, CheckBoxState.Checked);
             }
         }
     }
     finally
     {
         _updatingCheckedResources = false;
     }
 }
Exemplo n.º 6
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]);
                }
            }
        }
Exemplo n.º 7
0
 public void SetCheckState(IResource res, CheckBoxState state)
 {
     _chboxColumn.SetItemCheckState(res, state);
 }
Exemplo n.º 8
0
        public ChooseResTypeDialog(string choosenText, IResourceList validResTypes)
        {
            Store = Core.ResourceStore;

            InitializeComponent();
            CollectResourceTypesNames(validResTypes);

            SetupListView(_listResourceTypes, null, ref checkMajorTypes);
            SetupListView(_listLinkTypes, GetLinkItemText, ref checkLinkTypes);
            SetupListView(_listFileTypes, null, ref checkFileTypes);
            checkMajorTypes.AfterCheck += listResourceTypes_ItemCheck;
            checkLinkTypes.AfterCheck  += listLinkTypes_ItemCheck;
            checkFileTypes.AfterCheck  += listFileTypes_ItemCheck;

            //-----------------------------------------------------------------
            FillListContent(MajorTypes, _listResourceTypes);
            if (LinkTypes.Count > 0)
            {
                FillListContent(LinkTypes, _listLinkTypes);
                FillListContent(FormattedTypes, _listFileTypes);
            }
            else
            {
                _listFileTypes.Visible = _listLinkTypes.Visible =
                    label1.Visible     = label2.Visible = false;
                Size = new Size(Size.Width / 2 + 10, Size.Height);
                _listResourceTypes.Size   = new Size(Size.Width - 12, _listResourceTypes.Size.Height);
                _listResourceTypes.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left;
            }

            //-----------------------------------------------------------------
            if (choosenText == null)
            {
                checkAllResourceTypes.Checked = true;
                for (int i = 0; i < _listFileTypes.Nodes.Count; i++)
                {
                    checkFileTypes.SetItemCheckState(_listFileTypes.Nodes[i].Data, CheckBoxState.Checked);
                }
            }
            else
            {
                choosenText = choosenText.Replace("#", "|").Replace(",", "|");
                string[] choosenTypes = choosenText.Split('|');

                for (int i = 0; i < MajorTypes.Count; i++)
                {
                    IResource res = (IResource)_listResourceTypes.Nodes[i].Data;
                    if (Array.IndexOf(choosenTypes, res.GetStringProp("Name")) != -1)
                    {
                        checkMajorTypes.SetItemCheckState(res, CheckBoxState.Checked);
                    }
                }
                for (int i = 0; i < LinkTypes.Count; i++)
                {
                    IResource res = (IResource)_listLinkTypes.Nodes[i].Data;
                    if (Array.IndexOf(choosenTypes, res.GetStringProp("Name")) != -1)
                    {
                        checkLinkTypes.SetItemCheckState(res, CheckBoxState.Checked);
                    }
                }
                for (int i = 0; i < FormattedTypes.Count; i++)
                {
                    IResource res = (IResource)_listFileTypes.Nodes[i].Data;
                    if (Array.IndexOf(choosenTypes, res.GetStringProp("Name")) != -1)
                    {
                        checkFileTypes.SetItemCheckState(res, CheckBoxState.Checked);
                    }
                }

                if (!AnyItemChecked(checkLinkTypes) || !AnyItemChecked(checkFileTypes))
                {
                    for (int i = 0; i < _listFileTypes.Nodes.Count; i++)
                    {
                        checkFileTypes.SetItemCheckState(_listFileTypes.Nodes[i].Data, CheckBoxState.Checked);
                    }
                }
            }
            _listFileTypes.Enabled = AnyItemChecked(checkLinkTypes);
        }
Exemplo n.º 9
0
        private void ShowPaneImpl()
        {
            if (!Core.UserInterfaceAP.IsOwnerThread)
            {
                Core.UserInterfaceAP.QueueJob(new MethodInvoker(ShowPaneImpl));
                return;
            }
            _deletersListView.Nodes.Clear();
            IResourceList resTypes = Core.ResourceStore.GetAllResources("ResourceType");

            foreach (IResource resType in resTypes.ValidResources)
            {
                if (resType.GetIntProp("Internal") != 0)
                {
                    continue;
                }
                string type = resType.GetPropText(Core.Props.Name);
                if (type.Length > 0 && Core.ResourceStore.ResourceTypes.Exist(type))
                {
                    IResourceDeleter deleter = Core.PluginLoader.GetResourceDeleter(type);
                    if (deleter != null)
                    {
                        _deletersListView.Nodes.Add(resType);
                        bool canDelete = deleter.CanDeleteResource(null, false);
                        if (!canDelete)
                        {
                            _confirmDeleteColumn.SetItemCheckState(resType, CheckBoxState.Grayed | CheckBoxState.Unchecked);
                        }
                        else
                        {
                            _confirmDeleteColumn.SetItemCheckState(resType,
                                                                   ResourceDeleterOptions.GetConfirmDeleteToRecycleBin(type) ? CheckBoxState.Checked : CheckBoxState.Unchecked);
                        }
                        bool canDeletePermanently = deleter.CanDeleteResource(null, true);
                        if (!canDeletePermanently)
                        {
                            _confirmPermanentDeleteColumn.SetItemCheckState(resType, CheckBoxState.Grayed | CheckBoxState.Unchecked);
                        }
                        else
                        {
                            _confirmPermanentDeleteColumn.SetItemCheckState(resType,
                                                                            ResourceDeleterOptions.GetConfirmDeletePermanently(type) ? CheckBoxState.Checked : CheckBoxState.Unchecked);
                        }

                        if (!deleter.CanIgnoreRecyclebin())
                        {
                            _alwaysDeletePermanentlyColumn.SetItemCheckState(resType, CheckBoxState.Grayed | CheckBoxState.Unchecked);
                        }
                        else
                        if (canDelete != canDeletePermanently)
                        {
                            _alwaysDeletePermanentlyColumn.SetItemCheckState(resType, CheckBoxState.Grayed |
                                                                             (canDelete ? CheckBoxState.Unchecked : CheckBoxState.Checked));
                        }
                        else
                        {
                            _alwaysDeletePermanentlyColumn.SetItemCheckState(resType,
                                                                             ResourceDeleterOptions.GetDeleteAlwaysPermanently(type) ? CheckBoxState.Checked : CheckBoxState.Unchecked);
                        }
                    }
                }
            }
        }