public override void EnumerationStarting() { if (Core.State == CoreState.ShuttingDown) { Interrupted = true; return; } _conversationManager.ConversationPeriod = GetConversationTimeSpan(); _minUpdateDate = GetMinUpdateDate(); _maxUpdateDate = GetMaxUpdateDate(); _startedInIdleMode = Core.IsSystemIdle; if (_minUpdateDate == DateTime.MaxValue || _maxUpdateDate == DateTime.MinValue) { DeleteICQConversations(); _indexStartDate = DateTime.MinValue; } if (UINsCollection.GetUINs().Count > 0) { _icqAB = new AddressBook("ICQ Contacts", _icqConversationResName); _icqAB.IsExportable = false; DisposeDBWatchers(); DoImporting(); } }
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; }
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(); } }
public void Register() { _thePlugin = this; _folderWatchers = new HashMap(); _dbLocations = new HashSet(); _icqContacts = new ArrayList(); _icqMessages = new ArrayList(); _idResources = new IntHashSet(); RegisterTypes(); IUIManager uiMgr = Core.UIManager; uiMgr.RegisterOptionsGroup("Instant Messaging", "The Instant Messaging options enable you to control how [product name] works with supported instant messaging programs."); OptionsPaneCreator icqPaneCreator = ICQOptionsPane.ICQOptionsPaneCreator; uiMgr.RegisterOptionsPane("Instant Messaging", "ICQ", icqPaneCreator, "The ICQ options enable you to specify which ICQ accounts should be indexed, and how [product name] should build conversations from ICQ messages."); uiMgr.AddOptionsChangesListener("Instant Messaging", "ICQ", ICQOptionsChanged); if (UINsCollection.GetUINs().Count > 0) { uiMgr.RegisterWizardPane("ICQ", icqPaneCreator, 10); Core.TabManager.RegisterResourceTypeTab("IM", "IM", _icqConversationResName, 2); _correspondentPane = new CorrespondentCtrl(); _correspondentPane.IniSection = "ICQ"; _correspondentPane.SetCorresponentFilterList(Core.ResourceStore.FindResourcesWithProp(null, "ICQAcct")); Image img = Utils.TryGetEmbeddedResourceImageFromAssembly(Assembly.GetExecutingAssembly(), "ICQPlugin.Icons.Correspondents24.png"); Core.LeftSidebar.RegisterResourceStructurePane("ICQCorrespondents", "IM", "ICQ Correspondents", img, _correspondentPane); Core.LeftSidebar.RegisterViewPaneShortcut("ICQCorrespondents", Keys.Control | Keys.Alt | Keys.Q); } IPluginLoader loader = Core.PluginLoader; IActionManager actionManager = Core.ActionManager; loader.RegisterResourceDisplayer(_icqConversationResName, this); actionManager.RegisterLinkClickAction(new ConversationLinkClickAction(), _icqConversationResName, null); _conversationManager = new IMConversationsManager(_icqConversationResName, "ICQ Conversation", "Subject", GetConversationTimeSpan(), _propICQAcct, _propFromICQ, _propToICQ, this); _conversationManager.ReverseMode = GetReverseMode(); SaveConversationAction saveConvAction = new SaveConversationAction(_conversationManager, _propNickName); actionManager.RegisterContextMenuAction(saveConvAction, ActionGroups.ITEM_OPEN_ACTIONS, ListAnchor.Last, "Save to File...", null, _icqConversationResName, null); actionManager.RegisterActionComponent(saveConvAction, "SaveAs", _icqConversationResName, null); EmailConversationAction mailConvAction = new EmailConversationAction(_conversationManager, _propNickName); actionManager.RegisterContextMenuAction(mailConvAction, ActionGroups.ITEM_OPEN_ACTIONS, ListAnchor.Last, "Send by Email", null, _icqConversationResName, null); actionManager.RegisterActionComponent(mailConvAction, "SendByMail", _icqConversationResName, null); loader.RegisterResourceSerializer(_icqAccountResName, new ICQAccountSerializer()); loader.RegisterResourceTextProvider(_icqConversationResName, _conversationManager); loader.RegisterResourceTextProvider(_contactResName, this); Core.ResourceBrowser.RegisterLinksPaneFilter(_icqConversationResName, new ItemRecipientsFilter()); Core.ResourceBrowser.RegisterLinksGroup("Accounts", new[] { _propICQAcct }, ListAnchor.First); // Upgrade information about ICQ address book - set its // ContentType property so that it could be filtered out when // this plugin is switched off. IResource ab = Core.ResourceStore.FindUniqueResource("AddessBook", "Name", "ICQ Contacts"); if (ab != null) { ab.SetProp("ContentType", _icqConversationResName); } Core.ResourceBrowser.SetDefaultViewSettings("IM", AutoPreviewMode.Off, true); }