示例#1
0
 public void Start(StartServiceContext context)
 {
     m_locator = new Geolocator
                     {
                         MovementThreshold = C.Default.MovementThreshold
                     };
     m_locator.PositionChanged += PositionChanged_Locator;
 }
示例#2
0
        public void Start(StartServiceContext context)
        {
            m_source = new CancellationTokenSource();
            var token = m_source.Token;

            m_updateTask = Task
                    .Delay(Delay_InitialUpdateStations, token)
                    .ContinueWith(t => UpdateStations(token), token)
                    ;
        }
示例#3
0
 public static void Start(StartServiceContext context)
 {
     var state = SetState(States.Started);
     if (state == States.Stopped)
     {
         StartService (App, context);
         StartService (Log, context);
         StartService (Locator, context);
         StartService (Stations, context);
     }
 }
示例#4
0
 public void Start(StartServiceContext context)
 {
     m_isRunning = true;
     Services.App.Async_Invoke(AsyncGroup.Log_UpdateErrors, Log_UpdateErrors);
 }
示例#5
0
 public void Start(StartServiceContext context)
 {
     Runner  = context.Runner        ;
     if (State == null)
     {
         State= CreateEmptyState()            ;
     }
 }
示例#6
0
 static void StartService(this IService service, StartServiceContext context)
 {
     if (service != null)
     {
         try
         {
             service.Start(context);
         }
         catch (Exception exc)
         {
             Source.Common.Log.Exception ("Failed to start service {0}: {1}", service.GetType().Name, exc);
         }
     }
 }