Exemplo n.º 1
0
        public override void OK()
        {
            IntArrayList uins = IntArrayListPool.Alloc();

            try
            {
                foreach (ListViewItem item in _UINsList.Items)
                {
                    if (item.Checked)
                    {
                        uins.Add((int)item.Tag);
                    }
                }
                uins.Sort();
                bool changed = (uins.Count != _uins.Count);
                if (!changed)
                {
                    for (int i = 0; i < uins.Count; ++i)
                    {
                        if (uins[i] != _uins[i])
                        {
                            changed = true;
                            break;
                        }
                    }
                }
                if (!IsStartupPane)
                {
                    ICQPlugin.SetBuildConverstionOnline(_indexOnlineCheckBox.Checked);
                    ICQPlugin.SetReverseMode(_reverseModeCheckBox.Checked);
                }
                if (!IsStartupPane && _convsTimeSpan.Value != _minutes)
                {
                    ICQPlugin.SetConversationTimeSpan(
                        new TimeSpan(((long)_convsTimeSpan.Value) * 60 * 10000000));
                    changed = true;
                }
                changed = changed ||
                          _importOnly2003bCheckbox.Checked != ICQPlugin.GetImportOnly2003b() ||
                          (_indexOnlineCheckBox.Checked &&
                           _indexOnlineCheckBox.Checked != ICQPlugin.GetBuildConverstionOnline());
                ICQPlugin.SetImportOnly2003b(_importOnly2003bCheckbox.Checked);
                // rebuild conversations if there were changes
                if (changed || IsStartupPane)
                {
                    ICQPlugin.SetUpdateDates(DateTime.MaxValue, DateTime.MinValue);
                    ICQPlugin.SaveUINs2BeIndexed(uins);
                    if (!IsStartupPane)
                    {
                        ICQPlugin.AsyncUpdateHistory();
                    }
                }
            }
            finally
            {
                IntArrayListPool.Dispose(uins);
            }
        }
Exemplo n.º 2
0
        public override void ShowPane()
        {
            if (IsStartupPane)
            {
                _conversationsPanel.Visible   = false;
                _importOnly2003bCheckbox.Left = _UINsList.Left = label5.Left = 0;
            }
            else
            {
                _conversationsPanel.Visible = true;
                TimeSpan span = ICQPlugin.GetConversationTimeSpan();
                _minutes = (span.Minutes + span.Hours * 60 + span.Days * 24 * 60);
                if (_minutes >= _convsTimeSpan.Minimum && _minutes <= _convsTimeSpan.Maximum)
                {
                    _convsTimeSpan.Value = _minutes;
                }
                _indexOnlineCheckBox.Checked = ICQPlugin.GetBuildConverstionOnline();
                _reverseModeCheckBox.Checked = ICQPlugin.GetReverseMode();
            }
//            _uins = (IntArrayList) UINsCollection.GetUINs().Clone();
            _uins = new List <int>(UINsCollection.GetUINs());
            _UINsList.Items.Clear();
            for (int i = 0; i < _uins.Count;)
            {
                ListViewItem item = new ListViewItem();
                int          uin  = _uins[i];
                item.Text = uin.ToString();
                ICQContact aContact = ContactsFactory.GetInstance().GetContact(uin);
                item.SubItems.Add(aContact.NickName);
                item.ImageIndex = 0;
                item.Tag        = uin;
                if (item.Checked = ICQPlugin.IndexedUIN(uin))
                {
                    ++i;
                }
                else
                {
                    _uins.RemoveAt(i);   // leave in list only checked uins
                }
                _UINsList.Items.Add(item);
            }
            _importOnly2003bCheckbox.Checked = ICQPlugin.GetImportOnly2003b();
            _importOnly2003bCheckbox.Visible = UINsCollection.HasModernDBs;
        }
Exemplo n.º 3
0
        private void _okButton_Click(object sender, System.EventArgs e)
        {
            IntArrayList uins = IntArrayListPool.Alloc();

            try
            {
                foreach (ListViewItem item in _UINsList.Items)
                {
                    int uin = (int)item.Tag;
                    if (item.Checked || ICQPlugin.IndexedUIN(uin))
                    {
                        uins.Add(uin);
                    }
                }
                ICQPlugin.SetUpdateDates(DateTime.MaxValue, DateTime.MinValue);
                ICQPlugin.SaveUINs2BeIndexed(uins);
                ICQPlugin.AsyncUpdateHistory();
            }
            finally
            {
                IntArrayListPool.Dispose(uins);
            }
        }
Exemplo n.º 4
0
        public RebuildForm()
        {
            InitializeComponent();
            RestoreSettings();
//            IntArrayList uins = (IntArrayList) UINsCollection.GetUINs().Clone();
            List <int> uins = new List <int>(UINsCollection.GetUINs());

            _UINsList.BeginUpdate();
            try
            {
                _UINsList.Items.Clear();
                for (int i = 0; i < uins.Count;)
                {
                    ListViewItem item = new ListViewItem();
                    int          uin  = uins[i];
                    item.Text = uin.ToString();
                    ICQContact aContact = ContactsFactory.GetInstance().GetContact(uin);
                    item.SubItems.Add(aContact.NickName);
                    item.ImageIndex = 0;
                    item.Tag        = uin;
                    if (item.Checked = ICQPlugin.IndexedUIN(uin))
                    {
                        ++i;
                    }
                    else
                    {
                        uins.RemoveAt(i);   // leave in list only checked uins
                    }
                    _UINsList.Items.Add(item);
                }
            }
            finally
            {
                _UINsList.EndUpdate();
            }
        }