Пример #1
0
        public void RecordModuleInitialized(string moduleName)
        {
            ModuleTrackingState moduleTrackingState = this.GetModuleTrackingState(moduleName);

            if (moduleTrackingState != null)
            {
                moduleTrackingState.ModuleInitializationStatus = ModuleInitializationStatus.Initialized;
            }

            this.logger.Log(string.Format("{0} module initialized.", moduleName), Category.Debug, Priority.Low);
        }
Пример #2
0
 public ModuleTracker()
 {
     this.moduleBaseTrackingState = new ModuleTrackingState
     {
         ModuleName = WellKnownModuleNames.ModuleBase,
         ExpectedDiscoveryMethod    = DiscoveryMethod.ApplicationReference,
         ExpectedInitializationMode = InitializationMode.WhenAvailable,
         ExpectedDownloadTiming     = DownloadTiming.WithApplication,
         //ConfiguredDependencies = WellKnownModuleNames.ModuleD,
     };
     this.moduleClienteTrackingState = new ModuleTrackingState
     {
         ModuleName = WellKnownModuleNames.ModuleCliente,
         ExpectedDiscoveryMethod    = DiscoveryMethod.DirectorySweep,
         ExpectedInitializationMode = InitializationMode.OnDemand,
         ExpectedDownloadTiming     = DownloadTiming.InBackground,
     };
     this.moduleFinanceiroTrackingState = new ModuleTrackingState
     {
         ModuleName = WellKnownModuleNames.ModuleFinanceiro,
         ExpectedDiscoveryMethod    = DiscoveryMethod.ApplicationReference,
         ExpectedInitializationMode = InitializationMode.OnDemand,
         ExpectedDownloadTiming     = DownloadTiming.WithApplication,
     };
     this.moduleFuncionarioTrackingState = new ModuleTrackingState
     {
         ModuleName = WellKnownModuleNames.ModuleFuncionario,
         ExpectedDiscoveryMethod    = DiscoveryMethod.DirectorySweep,
         ExpectedInitializationMode = InitializationMode.WhenAvailable,
         ExpectedDownloadTiming     = DownloadTiming.InBackground,
     };
     this.moduleProdutoTrackingState = new ModuleTrackingState
     {
         ModuleName = WellKnownModuleNames.ModuleProduto,
         ExpectedDiscoveryMethod    = DiscoveryMethod.ConfigurationManifest,
         ExpectedInitializationMode = InitializationMode.OnDemand,
         ExpectedDownloadTiming     = DownloadTiming.InBackground,
     };
     this.moduleVendaGenericTrackingState = new ModuleTrackingState
     {
         ModuleName = WellKnownModuleNames.ModuleVendaGeneric,
         ExpectedDiscoveryMethod    = DiscoveryMethod.ConfigurationManifest,
         ExpectedInitializationMode = InitializationMode.OnDemand,
         ExpectedDownloadTiming     = DownloadTiming.InBackground,
         //ConfiguredDependencies = WellKnownModuleNames.Produto,
     };
 }
Пример #3
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("'{0}' module is loading {1}/{2} bytes.", moduleName, bytesReceived, totalBytesToReceive),
                Category.Debug,
                Priority.Low);
        }