Esempio n. 1
0
        public void Start(string hostName, bool isDisposing)
        {
            //IL_005b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0065: Expected O, but got Unknown
            if (!isStarted)
            {
                if (settings == null)
                {
                    settings = new TelemetryManifestManagerSettings(hostName);
                }
                if (remoteControlClient == null)
                {
                    remoteControlClient = (IRemoteControlClient)(object)new RemoteControlClient(settings.HostId, settings.BaseUrl, settings.RelativePath, (int)DownloadInterval.TotalMinutes, 60, 6);
                }
                if (!isDisposing)
                {
                    CancellationToken token      = tokenSource.Token;
                    Func <Task>       actionTask = async delegate
                    {
                        if (!token.IsCancellationRequested)
                        {
                            await Check((BehaviorOnStale)0, token).ConfigureAwait(false);

                            if (!token.IsCancellationRequested && CurrentManifest == null)
                            {
                                await Check((BehaviorOnStale)2, token).ConfigureAwait(false);
                            }
                        }
                    };
                    scheduler.Schedule(actionTask, token);
                    scheduler.ScheduleTimed((Func <Task>)Check);
                }
                isStarted = true;
            }
        }
Esempio n. 2
0
 public void PostEvent(TelemetryEvent telemetryEvent)
 {
     CodeContract.RequiresArgumentNotNull <TelemetryEvent>(telemetryEvent, "telemetryEvent");
     if (!base.IsDisposed)
     {
         queue.Enqueue(telemetryEvent);
         Action action = ProcessEvents;
         scheduler.ScheduleTimed(action);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Post context property. That property is posted to the backend immediately and not attached to the every event.
 /// Property could be reserved or regular.
 /// Reserved property will accomplished with prefix "Reserved."
 /// </summary>
 /// <param name="propertyName"></param>
 /// <param name="propertyValue"></param>
 /// <param name="isReserved">is property reserved</param>
 internal void PostProperty(string propertyName, object propertyValue, bool isReserved)
 {
     if (!base.IsDisposed)
     {
         CodeContract.RequiresArgumentNotNullAndNotWhiteSpace(propertyName, "propertyName");
         CodeContract.RequiresArgumentNotNull <object>(propertyValue, "propertyValue");
         postedProperties.Enqueue(new PostPropertyEntry(propertyName, propertyValue, isReserved));
         Action action = FlushPostedProperties;
         scheduler.ScheduleTimed(action);
     }
 }