SenseNet.Messaging.NotificationHandler.StartNotificationSystem C# (CSharp) Method

StartNotificationSystem() static private method

static private StartNotificationSystem ( ) : bool
return bool
        internal static bool StartNotificationSystem()
        {
            if (Configuration.Enabled && !_started)
            {
                var pollInterval = Configuration.TimerInterval * 60.0 * 1000.0;
                LockingTimeframe = TimeoutMultiplier * Configuration.TimerInterval;
                AppDomainId = Guid.NewGuid().ToString();

                _notifTimer = new System.Timers.Timer(pollInterval);
                _notifTimer.Elapsed += new System.Timers.ElapsedEventHandler(NotifTimerElapsed);
                _notifTimer.Disposed += new EventHandler(NotifTimerDisposed);
                _notifTimer.Enabled = true;

                _started = true;
            }
            return _started;
        }

Usage Example

示例#1
0
 /// <summary>
 /// Starts the service if it is enabled in the configuration.
 /// </summary>
 /// <returns>True if the service has started.</returns>
 public bool Start()
 {
     return(NotificationHandler.StartNotificationSystem());
 }