public void RecordModuleConstracted(string moduleName) { ModuleTrackingState moduleTrackingState = this.GetModuleTrackingState(moduleName); if (moduleTrackingState != null) { moduleTrackingState.ModuleInitializationStatus = ModuleInitializationStatus.Constructed; } this.logger.Log(string.Format(CultureInfo.CurrentCulture, Resources.ModuleConstructed, moduleName), Category.Debug, Priority.Low); }
private void OnDataContextChanged() { if (this.moduleTrackingState != null) { this.moduleTrackingState.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(ModuleTrackingState_PropertyChanged); } this.moduleTrackingState = this.DataContext as ModuleTrackingState; if (this.moduleTrackingState != null) { this.moduleTrackingState.PropertyChanged += ModuleTrackingState_PropertyChanged; } this.UpdateLoadPropressTextBlockVisibility(); }
public ModuleTracker(ILoggerFacade logger) { if (logger == null) { throw new ArgumentNullException("logger"); } this.logger = logger; this.moduleATrackingState = new ModuleTrackingState { ModuleName = WellKnownModuleNames.ModuleA, ExpectedDiscoveryMethod = DiscoveryMethod.ApplicationReference, ExpectedInitializationMode = InitializationMode.WhenAvailable, ExpectedDownLoadTiming = DownLoadTiming.WithApplication, ConfiguredDependencies = WellKnownModuleNames.ModuleD }; this.moduleBTrackingState = new ModuleTrackingState { ModuleName = WellKnownModuleNames.ModuleB, ExpectedDiscoveryMethod = DiscoveryMethod.DirectorySweep, ExpectedInitializationMode = InitializationMode.OnDemand, ExpectedDownLoadTiming = DownLoadTiming.InBackground }; this.moduleCTrackingState = new ModuleTrackingState { ModuleName = WellKnownModuleNames.ModuleC, ExpectedDiscoveryMethod = DiscoveryMethod.ApplicationReference, ExpectedInitializationMode = InitializationMode.OnDemand, ExpectedDownLoadTiming = DownLoadTiming.WithApplication }; this.moduleDTrackingState = new ModuleTrackingState { ModuleName = WellKnownModuleNames.ModuleD, ExpectedDiscoveryMethod = DiscoveryMethod.DirectorySweep, ExpectedInitializationMode = InitializationMode.WhenAvailable, ExpectedDownLoadTiming = DownLoadTiming.InBackground }; }
public void RecordModuleDownloading(string moduleName, long bytesReceived, long totalBytesToReceive) { ModuleTrackingState moduleTrackingState = this.GetModuleTrackingState(moduleName); if (moduleTrackingState != null) { moduleTrackingState.BytesReceived = bytesReceived; moduleTrackingState.TotalBytesToReceive = totalBytesToReceive; if (bytesReceived < totalBytesToReceive) { moduleTrackingState.ModuleInitializationStatus = ModuleInitializationStatus.Downloading; } else { moduleTrackingState.ModuleInitializationStatus = ModuleInitializationStatus.Downloaded; } } this.logger.Log(string.Format(CultureInfo.CurrentCulture, Resources.ModuleLoadingProgress, moduleName, bytesReceived, totalBytesToReceive), Category.Debug, Priority.Low); }