Пример #1
0
    /// <summary>
    /// Executes the pings from the new thread.
    /// </summary>
    /// <param name="item">
    /// The publishable item.
    /// </param>
    /// <param name="itemUrl">
    /// The item Url.
    /// </param>
    private static void Ping(IPublishable item, Uri itemUrl)
    {
        try
        {
            Thread.Sleep(2000);

            // Ping the specified ping services.
            PingService.Send(itemUrl);

            // Send trackbacks and pingbacks.
            if (!BlogSettings.Instance.EnableTrackBackSend && !BlogSettings.Instance.EnablePingBackSend)
            {
                return;
            }

            if (item.Content.ToUpperInvariant().Contains("\"HTTP"))
            {
                Manager.Send(item, itemUrl);
            }
        }
        catch (Exception)
        {
            // We need to catch this exception so the application doesn't get killed.
        }
    }