private void PublishSmart()
        {
            var targetDatabases = new[] { Factory.GetDatabase("web") };
            var languages       = _db.Languages;

            PublishManager.PublishSmart(_db, targetDatabases, languages);
        }
        private static async void GenerateSpamComplaint(string hostName, Guid contactId, MessageItem message, DateTime dateTime)
        {
            var messageHandler = new SpamComplaintHandler(Factory.CreateObject("exm/spamComplaintsTaskPool", true) as ShortRunningTaskPool, Factory.CreateObject("exm/recipientListManagementTaskPool", true) as ShortRunningTaskPool);

            var spam = new Complaint
            {
                ContactId    = Cipher.Encrypt(contactId.ToString()),
                EmailAddress = message.To,
                MessageId    = Cipher.Encrypt(message.MessageId.ToString())
            };

            await messageHandler.HandleReportedMessages(new[] { spam });
        }
        public object ComputeFieldValue(IIndexable indexable)
        {
            Item indexItem = indexable as SitecoreIndexableItem;

            if (indexItem == null)
            {
                return(null);
            }

            if (indexItem.Database == null || indexItem.Database.Name == "core")
            {
                return(null);
            }

            using (new SiteContextSwitcher(SiteFactory.GetSite("website")))
            {
                return(GetFieldValue(indexItem));
            }
        }
 static GenerateEventService()
 {
     Cipher = Factory.CreateObject("exmAuthenticatedCipher", true) as IStringCipher;
 }