示例#1
0
        public RSSDiscover.RSSDiscoverResult[] GetSelectedResults()
        {
            ArrayList result = new ArrayList();

            foreach (JetListViewNode node in _resultList.Nodes)
            {
                if (_checkColumn.GetItemCheckState(node.Data) == CheckBoxState.Checked)
                {
                    result.Add(node.Data);
                }
            }
            return((RSSDiscover.RSSDiscoverResult[])result.ToArray(typeof(RSSDiscover.RSSDiscoverResult)));
        }
        private void SaveInfoStores()
        {
            _savingInfoStores = true;
            try
            {
                bool hadChanges = false;
                foreach (IResource store in _allStores)
                {
                    bool oldChecked = (store.GetIntProp(PROP.IgnoredFolder) == 0);
                    bool nowChecked = (_checkBoxColumn.GetItemCheckState(store) == CheckBoxState.Checked);
                    hadChanges = hadChanges || (oldChecked != nowChecked);

                    if (nowChecked)
                    {
                        store.DeleteProp(PROP.IgnoredFolder);
                    }
                    else
                    {
                        store.SetProp(PROP.IgnoredFolder, 1);
                    }
                }

                if (!IsStartupPane && hadChanges)
                {
                    OutlookSession.OutlookProcessor.SynchronizeFolderStructure();
                }
            }
            finally
            {
                _savingInfoStores = false;
            }
        }
示例#3
0
 private bool AnyItemChecked()
 {
     foreach (JetListViewNode node in _searchEngines.Nodes)
     {
         if (_checkColumn.GetItemCheckState(node.Data) == CheckBoxState.Checked)
         {
             return(true);
         }
     }
     return(false);
 }
示例#4
0
 private void SetFlagFromColumn(PropertyTypeTag tag, CheckBoxColumn column, ColumnDescriptorFlags flag)
 {
     if (column.GetItemCheckState(tag) == CheckBoxState.Checked)
     {
         tag.ColDesc.Flags |= flag;
     }
     else
     {
         tag.ColDesc.Flags &= ~flag;
     }
 }
示例#5
0
        private static bool AllItemsChecked(CheckBoxColumn col)
        {
            JetListView listView = col.OwnerControl;

            for (int i = 0; i < listView.Nodes.Count; i++)
            {
                if (col.GetItemCheckState(listView.Nodes [i].Data) == CheckBoxState.Unchecked)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#6
0
        /// <summary>
        /// Returns the list of resources selected in the pane.
        /// </summary>
        public override IResourceList GetSelection()
        {
            if (_chkColumn != null)
            {
                List <int> resourceIds = new List <int>();
                foreach (IResource res in _dataProvider.ResourceList)
                {
                    if (_chkColumn.GetItemCheckState(res) == CheckBoxState.Checked)
                    {
                        resourceIds.Add(res.Id);
                    }
                }
                return(Core.ResourceStore.ListFromIds(resourceIds, false));
            }

            if (_listView.ActiveResource == null)
            {
                return(Core.ResourceStore.EmptyResourceList);
            }
            return(_listView.ActiveResource.ToResourceList());
        }
示例#7
0
        private string  FormattedResources(bool deepName)
        {
            string result = "";

            for (int i = 0; i < _listFileTypes.Nodes.Count; i++)
            {
                if (checkFileTypes.GetItemCheckState(_listFileTypes.Nodes [i].Data) == CheckBoxState.Checked)
                {
                    string name = _listFileTypes.Nodes[i].Data.ToString();
                    if (deepName)
                    {
                        name = ResourceTypeHelper.ResTypeDeepName(name);
                    }
                    result += name + ", ";
                }
            }
            if (result.Length > 0)
            {
                result = result.Remove(result.Length - 2, 2);
            }
            return(result);
        }
示例#8
0
文件: DeletersPane.cs 项目: mo5h/omeo
 public override void OK()
 {
     foreach (JetListViewNode node in _deletersListView.Nodes)
     {
         IResource resType = (IResource)node.Data;
         string    type    = resType.GetPropText(Core.Props.Name);
         if (type.Length > 0)
         {
             CheckBoxState state = _confirmDeleteColumn.GetItemCheckState(resType);
             if (state == CheckBoxState.Checked)
             {
                 ResourceDeleterOptions.SetConfirmDeleteToRecycleBin(type, true);
             }
             else if (state == CheckBoxState.Unchecked)
             {
                 ResourceDeleterOptions.SetConfirmDeleteToRecycleBin(type, false);
             }
             ResourceDeleterOptions.SetConfirmDeletePermanently(type,
                                                                _confirmPermanentDeleteColumn.GetItemCheckState(resType) == CheckBoxState.Checked);
             ResourceDeleterOptions.SetDeleteAlwaysPermanently(type,
                                                               _alwaysDeletePermanentlyColumn.GetItemCheckState(resType) == CheckBoxState.Checked);
         }
     }
 }
示例#9
0
 public CheckBoxState GetCheckState(IResource res)
 {
     return(_chboxColumn.GetItemCheckState(res));
 }
示例#10
0
        private void okButton_Click(object sender, System.EventArgs e)
        {
            Debug.Assert(IsValidChecksCombination(), "OK conversions are called on illegal checks combination");
            if (checkAllResourceTypes.Checked)
            {
                ChosenResFull = AllResTypesRepresentation;
                ChosenResDeep = null;
            }
            else
            {
                ChosenResFull = ChosenResDeep = "";

                for (int i = 0; i < _listResourceTypes.Nodes.Count; i++)
                {
                    if (checkMajorTypes.GetItemCheckState(_listResourceTypes.Nodes[i].Data) == CheckBoxState.Checked)
                    {
                        string name = _listResourceTypes.Nodes[i].Data.ToString();
                        ChosenResFull += name + ", ";
                        ChosenResDeep += ((IResource)_listResourceTypes.Nodes[i].Data).GetStringProp("Name") + "|";
                    }
                }

                if (ChosenResFull.Length > 0)
                {
                    ChosenResFull = ChosenResFull.Remove(ChosenResFull.Length - 2, 2);
                    ChosenResDeep = ChosenResDeep.Remove(ChosenResDeep.Length - 1, 1);

                    if (AnyItemChecked(checkLinkTypes))
                    {
                        ChosenResFull += " and ";
                        ChosenResDeep += "|";
                    }
                }

                //-----------------------------------------------------------------
                for (int i = 0; i < _listLinkTypes.Nodes.Count; i++)
                {
                    if (checkLinkTypes.GetItemCheckState(_listLinkTypes.Nodes [i].Data) == CheckBoxState.Checked)
                    {
                        IResource link = (IResource)_listLinkTypes.Nodes[i].Data;
                        string    name = GetLinkItemText(link);

                        ChosenResFull += name + ", ";
                        ChosenResDeep += link.GetStringProp("Name") + "|";
                    }
                }

                if (ChosenResFull[ChosenResFull.Length - 1] == ' ')
                {
                    ChosenResFull = ChosenResFull.Remove(ChosenResFull.Length - 2, 2);
                    ChosenResDeep = ChosenResDeep.Remove(ChosenResDeep.Length - 1, 1);
                }

                //-----------------------------------------------------------------
                if (AnyItemChecked(checkLinkTypes))
                {
                    if (AllItemsChecked(checkFileTypes))
                    {
                        ChosenResFull += " within all formats";
                    }
                    else
                    {
                        ChosenResFull += " within " + FormattedResources(false);
                        ChosenResDeep += "#" + FormattedResources(true).Replace(", ", "|");
                    }
                }
            }
            DialogResult = DialogResult.OK;
        }