Exemplo n.º 1
0
        public void Startup()
        {
            IContactService contactService = (IContactService)Core.PluginLoader.GetPluginService(typeof(IContactService));

            if (contactService != null)
            {
                ContactBlockCreator creator = ICQContactBlock.CreateBlock;
                contactService.RegisterContactEditBlock(0, ListAnchor.Last, "ICQ Accounts", creator);
                contactService.RegisterContactEditBlock(ContactTabNames.GeneralTab, ListAnchor.Last, "ICQ Accounts", creator);
            }
            ISettingStore settings = Core.SettingStore;

            _indexStartDate = settings.ReadDate("Startup", "IndexStartDate", DateTime.MinValue);
            if (_indexStartDate > DateTime.MinValue)
            {
                _idleIndexing = settings.ReadBool("Startup", "IdleIndexing", false);
                bool needIdle = ObjectStore.ReadBool("ICQ", "NeedIdle", true);
                if (_idleIndexing && needIdle)
                {
                    Trace.WriteLine("Queueing conversations rebuild in idle mode", "ICQ.Plugin");
                    Core.ResourceAP.QueueIdleJob(this);
                }
                else
                {
                    Trace.WriteLine("_idleIndexing = " + _idleIndexing, "ICQ.Plugin");
                    Trace.WriteLine("NeedIdle = " + needIdle, "ICQ.Plugin");
                }
            }
            Core.StateChanged += Core_StateChanged;
        }