예제 #1
0
        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);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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
            };
        }
예제 #4
0
        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);
        }