private void UpdateStatusAfterInitialization(bool noData) { switch (Status) { case ProviderStatus.CancellationInProgress: //cancelation identical to Initialization. Status = ProviderStatus.CancellationComplete; _logger.Log(LogLevel.Information, "Finished cancellation. JsonFileProvider is now in State CancellationComplete."); break; case ProviderStatus.InitializationInProgress when noData: Status = ProviderStatus.Empty; _logger.Log(LogLevel.Information, "Was unable to collect information from file. " + "JsonFileProvider is now in State Empty."); break; case ProviderStatus.InitializationInProgress: Status = ProviderStatus.Initialized; _logger.Log(LogLevel.Information, "Finished initialization. ExcelFileProvider is now in State Initialized."); break; default: _logger.Log(LogLevel.Information, $"Initialization finished in State #{Status}."); break; } }
public APIProvider() { mdlog = LogManager.GetLogger(Name + ".M"); tdlog = LogManager.GetLogger(Name + ".T"); try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/QuantBox.nlog"); } catch(Exception ex) { tdlog.Warn(ex.Message); } timerConnect.Elapsed += timerConnect_Elapsed; timerDisconnect.Elapsed += timerDisconnect_Elapsed; timerAccount.Elapsed += timerAccount_Elapsed; timerPonstion.Elapsed += timerPonstion_Elapsed; InitCallbacks(); InitSettings(); BarFactory = new SmartQuant.Providers.BarFactory(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
public void setProvider(ProviderStatus newProviderStatus) { if (newProviderStatus != mProviderStatus) //we don't use 'mIsFirstFix' from Android { //update Status ProviderStatus oldStatus = mProviderStatus; mProviderStatus = newProviderStatus; //disable previous provider (we are currently only using one provider at a time) disableProvider(oldStatus); //enable new appropriate provider switch (mProviderStatus) { case ProviderStatus.USE_GPS: enableGpsProvider(); IsTrackingPosition = true; break; case ProviderStatus.USE_WIFI: IsTrackingPosition = true; enableWifiProvider(); break; case ProviderStatus.USE_NONE: IsTrackingPosition = false; break; } //let UI update itself if (OnProviderChange != null) { OnProviderChange(this, EventArgs.Empty); } } }
public void Init(byte Id, string Name) { _Id = Id; _Name = Name; mdlog = LogManager.GetLogger(Name + ".M"); tdlog = LogManager.GetLogger(Name + ".T"); try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/QuantBox.nlog"); } catch (Exception ex) { tdlog.Warn(ex.Message); } timerConnect.Elapsed += timerConnect_Elapsed; timerDisconnect.Elapsed += timerDisconnect_Elapsed; timerAccount.Elapsed += timerAccount_Elapsed; timerPonstion.Elapsed += timerPonstion_Elapsed; InitCallbacks(); InitSettings(); BarFactory = new SmartQuant.Providers.BarFactory(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
private FileLiteralProvider(IFileProvider fileProvider, CultureInfo inputLanguage, CultureInfo preferredLanguage) { FileProviderInstance = fileProvider; _status = ProviderStatus.Initialized; InputLanguage = inputLanguage; PreferredLanguage = preferredLanguage; }
private void OnConnecting(object sender, EventArgs e) { psIQFeed = ProviderStatus.Connecting; if (null != StatusChanged) { StatusChanged(this, new EventArgs()); } }
private void OnLoggedIn(object sender, EventArgs e) { psIQFeed = ProviderStatus.LoggedIn; if (null != StatusChanged) { StatusChanged(this, new EventArgs()); } }
private void Start() { _sampleManage = GetComponent <SampleManager>(); _sampleManage.OnSampleDataReady += () => { _providerStatus = ProviderStatus.Ready; }; }
/// <exception cref="ResourcesNotFoundException"> /// Thrown, if both <see cref="GlobalSettings.ResourcesAssembly" /> is not set and the entry assembly /// cannot be accesed. /// </exception> private void ReadDicts() { var rm = ResourcesManagerProvider.GetResourcesManager(); Dictionary <string, string> invariantFallback = null; //collect all Resource entries. var langs = CultureInfo.GetCultures(CultureTypes.AllCultures); foreach (var lang in langs) { try { //tryParents is false and will be handled in CultureInfoUtils insted, to avoid registering //same dict multiple times. var resourceSet = rm.GetResourceSet(lang, true, false); if (resourceSet == null) { continue; } if (lang.Equals(CultureInfo.InvariantCulture)) { invariantFallback = resourceSet.Cast <DictionaryEntry>().ToDictionary( r => r.Key.ToString(), r => r.Value.ToString()); } else { _dictOfDicts.Add(lang, resourceSet.Cast <DictionaryEntry>().ToDictionary( r => r.Key.ToString(), r => r.Value.ToString())); } } catch (CultureNotFoundException) { //all non-existent languages will be ignored. } } TryAddChangesIntoDictOfDicts(); if (_dictOfDicts.ContainsKey(InputLanguage)) { _dictOfDicts.Add(CultureInfo.InvariantCulture, invariantFallback); } //if Inputlanguage is not present, use invariant as replacement instead, because //InputLanguage is expected to always exist. else { ExceptionLoggingUtils.ThrowIf <InputLanguageNotFoundException>(invariantFallback == null, _logger, $"The given input language ({InputLanguage.EnglishName}) was not found in the " + "Resources files."); _dictOfDicts.Add(InputLanguage, invariantFallback); } _status = ProviderStatus.Initialized; }
private void Start() { _sampleManager = GetComponent <SampleManager>(); _xrCamera = GameObject.FindWithTag(SturfeeObjects.XRCamera).GetComponent <Camera>(); _sampleManager.OnSampleDataReady += PopulateFrames; _providerStatus = ProviderStatus.Initializing; }
private async Task <(Guid ProviderId, int Ukprn, string Name, ProviderType ProviderType, ProviderStatus ProviderStatus, string UkrlpProviderStatusDescription)> CreateProvider( int index, ProviderType providerType, ProviderStatus providerStatus, string ukrlpProviderStatusDescription) { var providerName = $"TestProvider{index}"; var provider = await TestData.CreateProvider(providerName, providerType, ukrlpProviderStatusDescription, status : providerStatus); return(provider.ProviderId, provider.Ukprn, providerName, providerType, providerStatus, ukrlpProviderStatusDescription); }
private void UpdateFramesReadyEvent() { _framesDownloaded++; if (_framesDownloaded == _sampleManager.GetDataLength()) { _providerStatus = ProviderStatus.Ready; AddVideoCamera(); AddCanvas(); } }
public QBProvider() { timerConnect.Elapsed += new System.Timers.ElapsedEventHandler(timerConnect_Elapsed); timerAccount.Elapsed += new System.Timers.ElapsedEventHandler(timerAccount_Elapsed); timerPonstion.Elapsed += new System.Timers.ElapsedEventHandler(timerPonstion_Elapsed); InitCallbacks(); InitSettings(); BarFactory = new BarFactory(); status = ProviderStatus.Unknown; ProviderManager.Add(this); }
private void disableProvider(ProviderStatus oldStatus) { switch (oldStatus) { case ProviderStatus.USE_GPS: disableGpsProvider(); break; case ProviderStatus.USE_WIFI: disableWifiProvider(); break; } }
public void CancelInitialization() { _logger.Log(LogLevel.Trace, "CancelInitialization function was called."); if (Status == ProviderStatus.InitializationInProgress) { //cancelation identical to Initialization. Status = ProviderStatus.CancellationInProgress; _logger.Log(LogLevel.Debug, "JsonFileProvider is now in the process of cancelling its initialization."); } }
public SimulationDataProvider(string name, int id) { this.simulator = new Simulator(); this.simulator.Error += new ExceptionEventHandler(this.OnError); this.simulator.NewObject += new SeriesObjectEventHandler(this.OnNewObject); this.simulator.LeaveInterval += new IntervalEventHandler(this.OnLeaveInterval); this.isConnected = false; this.status = ProviderStatus.Unknown; this.BarFactory = new BarFactory(false); this.seriesTable = new Hashtable(); this.slices = new Dictionary <long, int>(); ProviderManager.Add(this); ProviderManager.MarketDataSimulator = this; }
private void CPQrwXYoJ([In] object obj0, [In] FIXSessionIDEventArgs obj1) { this.isConnected = true; this.status = ProviderStatus.LoggedIn; if (this.a2W0G3uh5 != null) { this.a2W0G3uh5((object)this, EventArgs.Empty); } if (this.SsDnoMUvf == null) { return; } this.SsDnoMUvf((object)this, EventArgs.Empty); }
public HistoryDownloader() { try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/CTP.nlog"); } catch (Exception ex) { hdlog.Warn(ex.Message); } status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
/// <summary> /// Interrupts the Initialization (e.g. when shutting down the application during initialization) /// </summary> public void CancelInitialization() { if (_backgroundWorker == null) { return; } if (_backgroundWorker.IsBusy) { Status = ProviderStatus.CancellationInProgress; _logger.Log(LogLevel.Debug, "Cancellation started."); _backgroundWorker.CancelAsync(); } }
private void H3T4F4ZJZW([In] object obj0, [In] FIXSessionIDEventArgs obj1) { this.isConnected = true; this.status = ProviderStatus.LoggedIn; if (this.o6v4QitnW3 != null) { this.o6v4QitnW3((object)this, EventArgs.Empty); } if (this.BW04vSAahK == null) { return; } this.BW04vSAahK((object)this, EventArgs.Empty); }
public APIProvider() { try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/QuantBox.nlog"); } catch (Exception ex) { mdlog.Warn(ex.Message); } BarFactory = new SmartQuant.Providers.BarFactory(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
private void OnConnected(object sender, EventArgs e) { psIQFeed = ProviderStatus.Connected; if (null != StatusChanged) { StatusChanged(this, new EventArgs()); } if (null != Connected) { Connected(this, new EventArgs()); } iqf.HandleNewsMessage += new NewsMessageHandler(iqf_HandleNewsMessage); iqfl2.Open(); }
public QBProvider() { log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(@"Bin/CTP.log4net.config")); timerDisconnect.Elapsed += timerDisconnect_Elapsed; timerAccount.Elapsed += timerAccount_Elapsed; timerPonstion.Elapsed += timerPonstion_Elapsed; InitCallbacks(); InitSettings(); BarFactory = new SmartQuant.Providers.BarFactory(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
private static Provider CreateProviderSearchResult( int seed = 1, ProviderStatus status = ProviderStatus.Onboarded, string providerStatus = "Active") { return(new Provider { ProviderId = Guid.NewGuid(), ProviderName = $"TestSearchResult{seed}", Postcode = $"TE1 {seed}ST", Town = $"TestTown{seed}", Ukprn = seed.ToString("00000000"), ProviderStatus = (int)status, UkrlpProviderStatusDescription = providerStatus }); }
public void Connect() { if (!this.fIsConnected) { this.fIsConnected = true; this.fStatus = ProviderStatus.Connected; if (this.Connected != null) { this.Connected(this, EventArgs.Empty); } if (this.StatusChanged != null) { this.StatusChanged(this, EventArgs.Empty); } } }
private void OnDisconnected(object sender, EventArgs e) { psIQFeed = ProviderStatus.Disconnected; if (null != StatusChanged) { StatusChanged(this, new EventArgs()); } if (null != Disconnected) { Disconnected(this, new EventArgs()); } iqf.LoggedInEventHandler -= OnLoggedIn; iqf.ConnectingEventHandler -= OnConnecting; iqf.ConnectedEventHandler -= OnConnected; iqf.DisconnectedEventHandler -= OnDisconnected; }
private void L0C4OEBGEG([In] object obj0, [In] FIXSessionIDEventArgs obj1) { if (!this.isConnected) { return; } this.mdRequests.Clear(); this.isConnected = false; this.status = ProviderStatus.Disconnected; if (this.Xmn4o6calw != null) { this.Xmn4o6calw((object)this, EventArgs.Empty); } if (this.BW04vSAahK == null) { return; } this.BW04vSAahK((object)this, EventArgs.Empty); }
public EsunnyProvider() { try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/QuantBox.nlog"); } catch(Exception ex) { ehlog.Warn(ex.Message); } timerDisconnect.Elapsed += timerDisconnect_Elapsed; InitCallbacks(); InitSettings(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
private void qKXl1YwC8([In] object obj0, [In] FIXSessionIDEventArgs obj1) { if (!this.isConnected) { return; } this.mdRequests.Clear(); this.isConnected = false; this.status = ProviderStatus.Disconnected; if (this.UUEcVhfVS != null) { this.UUEcVhfVS((object)this, EventArgs.Empty); } if (this.SsDnoMUvf == null) { return; } this.SsDnoMUvf((object)this, EventArgs.Empty); }
public EsunnyProvider() { try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/QuantBox.nlog"); } catch (Exception ex) { ehlog.Warn(ex.Message); } timerDisconnect.Elapsed += timerDisconnect_Elapsed; InitCallbacks(); InitSettings(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
/// <summary> /// Updates the internal dictionary of translations at <paramref name="key" /> with the given dictionary. /// Only languages contained in <paramref name="texts" /> will be updated. /// Will automatically write to file, if this is the first Update call /// and no file existed upon creation of this object. /// </summary> /// <exception cref="ArgumentNullException">Thrown, if <paramref name="key" /> is null.</exception> /// <param name="key">The entry for which translations should be updated.</param> /// <param name="texts"> /// The new translations. If list is null or empty, no changes will be made to the dictionary. /// </param> public void Update(string key, IEnumerable <TextLocalization> texts) { //null checks. ExceptionLoggingUtils.ThrowIfNull(_logger, nameof(Update), (object)key, nameof(key), "Unable to update dictionary for null key."); if (texts == null) { //no exception has to be thrown here, because null is treated like empty list and //no translations will be updated. _logger.Log(LogLevel.Debug, "Unable to update dictionary for null translations. " + "No translations were updated."); return; } //logging. IList <TextLocalization> textsEnumerated = texts.ToList(); var textsString = string.Join(", ", textsEnumerated.Select(l => l.ToString())); _logger.Log(LogLevel.Trace, $"Update was called with {{{textsString}}} as translations for key ({key})."); //dictionary updates. if (!UpdateDictionary(key, textsEnumerated)) { _logger.Log(LogLevel.Debug, "Did not update dictionary."); return; } //create file based on first entry, //if dictionary was updated and the file was created by JsonFileProvider itself. if (Status == ProviderStatus.Empty) { _logger.Log(LogLevel.Debug, "First update after empty sheet was created."); _fileHandler.ExcelWriteActions(_dictOfDicts); Status = ProviderStatus.Initialized; _logger.Log(LogLevel.Information, "Finished updating dictionary. " + "ExcelFileProvider is now in State Initialized."); } else { _logger.Log(LogLevel.Debug, "Finished updating dictionary."); } }
/// <summary> /// Class internal clean up after BackgroundWorker finished. /// </summary> private void LoadExcelLanguageFileAsyncCompleted(object sender, RunWorkerCompletedEventArgs e) { if (Status == ProviderStatus.CancellationInProgress) { Status = ProviderStatus.CancellationComplete; _logger.Log(LogLevel.Information, "Finished cancellation. ExcelFileProvider is now in State CancellationComplete."); return; } if (e.Error != null) { Status = ProviderStatus.Empty; _logger.Log(LogLevel.Information, $"Finished initialization with {e.Error.GetType()} ({e.Error.Message}). " + "ExcelFileProvider is now in State Empty."); return; } if (Status != ProviderStatus.InitializationInProgress) { _logger.Log(LogLevel.Information, $"Initialization finished in State #{Status}."); } //Result is read here, because it is only now guarenteed to exist. _dictOfDicts = e.Result as Dictionary <CultureInfo, Dictionary <string, string> >; if (_dictOfDicts == null || _dictOfDicts.Count == 0) { Status = ProviderStatus.Empty; _logger.Log(LogLevel.Information, "Was unable to collect information from file. " + "ExcelFileProvider is now in State Empty."); } else { Status = ProviderStatus.Initialized; _logger.Log(LogLevel.Information, "Finished initialization. ExcelFileProvider is now in State Initialized."); } }
public void Disconnect() { if (this.fIsConnected) { foreach (SimulationExecutionProcessor simulationExecutionProcessor in new ArrayList(this.fProcessors.Values)) { simulationExecutionProcessor.Cancel(); } this.fIsConnected = false; this.fStatus = ProviderStatus.Disconnected; if (this.Disconnected != null) { this.Disconnected(this, EventArgs.Empty); } if (this.StatusChanged != null) { this.StatusChanged(this, EventArgs.Empty); } } }
private void Awake() { _providerStatus = ProviderStatus.Initializing; //Configure ArKit UnityARSessionNativeInterface arKitSession = UnityARSessionNativeInterface.GetARSessionNativeInterface(); #if !UNITY_EDITOR // config //Application.targetFrameRate = 60; ARKitWorldTrackingSessionConfiguration config = new ARKitWorldTrackingSessionConfiguration { planeDetection = UnityARPlaneDetection.Horizontal, alignment = UnityARAlignment.UnityARAlignmentGravity, getPointCloudData = true, enableLightEstimation = true, enableAutoFocus = false }; if (!config.IsSupported) { Debug.LogError("Tracking is not supported on this device"); ToastManager.Instance.ShowToast(" Session Error : ArKit is not supported on this device."); _providerStatus = ProviderStatus.NotSupported; } else { _providerStatus = ProviderStatus.Ready; arKitSession.RunWithConfigAndOptions(config, UnityARSessionRunOption.ARSessionRunOptionResetTracking); } #else UnityARCamera scamera = new UnityARCamera(); scamera.worldTransform = new UnityARMatrix4x4(new Vector4(1, 0, 0, 0), new Vector4(0, 1, 0, 0), new Vector4(0, 0, 1, 0), new Vector4(0, 0, 0, 1)); Matrix4x4 projMat = Matrix4x4.Perspective(60.0f, 1.33f, 0.1f, 30.0f); scamera.projectionMatrix = new UnityARMatrix4x4(projMat.GetColumn(0), projMat.GetColumn(1), projMat.GetColumn(2), projMat.GetColumn(3)); UnityARSessionNativeInterface.SetStaticCamera(scamera); _providerStatus = ProviderStatus.Ready; #endif }
public CTPProvider() { //log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(@"Bin/CTP.log4net.config")); try { LogManager.Configuration = new XmlLoggingConfiguration(@"Bin/CTP.nlog"); } catch(Exception ex) { tdlog.Warn(ex.Message); } timerDisconnect.Elapsed += timerDisconnect_Elapsed; timerAccount.Elapsed += timerAccount_Elapsed; timerPonstion.Elapsed += timerPonstion_Elapsed; InitCallbacks(); InitSettings(); BarFactory = new SmartQuant.Providers.BarFactory(); status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
private void ChangeStatus(ProviderStatus status) { this.Status = status; this.EmitStatusChanged(); }
public void setProvider(ProviderStatus newProviderStatus) { if (newProviderStatus != mProviderStatus) //we don't use 'mIsFirstFix' from Android { //update Status ProviderStatus oldStatus = mProviderStatus; mProviderStatus = newProviderStatus; //disable previous provider (we are currently only using one provider at a time) disableProvider(oldStatus); //enable new appropriate provider switch (mProviderStatus) { case ProviderStatus.USE_GPS: enableGpsProvider(); IsTrackingPosition = true; break; case ProviderStatus.USE_WIFI: IsTrackingPosition = true; enableWifiProvider(); break; case ProviderStatus.USE_NONE: IsTrackingPosition = false; break; } //let UI update itself if (OnProviderChange != null) OnProviderChange(this, EventArgs.Empty); } }
private void ChangeStatus(ProviderStatus status) { this.status = status; EmitStatusChangedEvent(); }
public Provider(Framework framework) { this.framework = framework; this.status = ProviderStatus.Disconnected; }
protected virtual void OnDisconnect() { Status = ProviderStatus.Disconnecting; Status = ProviderStatus.Disconnected; }
private void CPQrwXYoJ([In] object obj0, [In] FIXSessionIDEventArgs obj1) { this.isConnected = true; this.status = ProviderStatus.LoggedIn; if (this.a2W0G3uh5 != null) this.a2W0G3uh5((object)this, EventArgs.Empty); if (this.SsDnoMUvf == null) return; this.SsDnoMUvf((object)this, EventArgs.Empty); }
private void qKXl1YwC8([In] object obj0, [In] FIXSessionIDEventArgs obj1) { if (!this.isConnected) return; this.mdRequests.Clear(); this.isConnected = false; this.status = ProviderStatus.Disconnected; if (this.UUEcVhfVS != null) this.UUEcVhfVS((object)this, EventArgs.Empty); if (this.SsDnoMUvf == null) return; this.SsDnoMUvf((object)this, EventArgs.Empty); }
/// <summary> /// Gets the status. /// </summary> /// <returns></returns> public override ProviderStatus GetStatus() { var status = new ProviderStatus(); if(this.ServiceIsAvailable()) { status.Code = 200; status.Message = string.Format(CultureInfo.CurrentCulture, Resources.OKMessage); this.Logger.Log(string.Format(CultureInfo.CurrentCulture, Resources.LogInfoMessage, this.Name, status.Message), System.Diagnostics.TraceLevel.Info, 0); } else { status.Code = 400; status.Message = string.Format(CultureInfo.CurrentCulture, Resources.FailMessage); this.Logger.Log(string.Format(CultureInfo.CurrentCulture, Resources.LogErrorMessage, this.Name, status.Message), System.Diagnostics.TraceLevel.Error, 400); } return status; }
public HistoryDownloader() { status = ProviderStatus.Unknown; SmartQuant.Providers.ProviderManager.Add(this); }
private void L0C4OEBGEG([In] object obj0, [In] FIXSessionIDEventArgs obj1) { if (!this.isConnected) return; this.mdRequests.Clear(); this.isConnected = false; this.status = ProviderStatus.Disconnected; if (this.Xmn4o6calw != null) this.Xmn4o6calw((object)this, EventArgs.Empty); if (this.BW04vSAahK == null) return; this.BW04vSAahK((object)this, EventArgs.Empty); }
private void H3T4F4ZJZW([In] object obj0, [In] FIXSessionIDEventArgs obj1) { this.isConnected = true; this.status = ProviderStatus.LoggedIn; if (this.o6v4QitnW3 != null) this.o6v4QitnW3((object)this, EventArgs.Empty); if (this.BW04vSAahK == null) return; this.BW04vSAahK((object)this, EventArgs.Empty); }