예제 #1
0
        public JobDispatcher(IDecoderJob job)
        {
            _worker = new BackgroundWorker();
            _worker.DoWork += new DoWorkEventHandler(DoJob);
            _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(JobCompleted);
            _worker.ProgressChanged += new ProgressChangedEventHandler(JobProgressChanged);
            _worker.WorkerReportsProgress = true;
            _worker.WorkerSupportsCancellation = true;
            _job = job;
            _status = new JobStatus();
            _logger = new BasicLogger();

            AssemblyVersionInfo vInfo = new AssemblyVersionInfo(typeof(JobBase));
            _logger.WriteLogMessage(String.Format("*** {0} {1}.{2} - (build {3})", vInfo.Title, vInfo.Version.Major, vInfo.Version.Minor, vInfo.LastBuildDate.ToString("yyMMdd-HHmm")), LogLevel.Info);
            _logger.WriteLogMessage(String.Format("*** Xml Schema Version {0}", D900Cdr.Schema.D900CdrDefinitionProvider.Instance.XmlVersion), LogLevel.Info);
        }
예제 #2
0
        public JobDispatcher(IDecoderJob job)
        {
            _worker                            = new BackgroundWorker();
            _worker.DoWork                    += new DoWorkEventHandler(DoJob);
            _worker.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(JobCompleted);
            _worker.ProgressChanged           += new ProgressChangedEventHandler(JobProgressChanged);
            _worker.WorkerReportsProgress      = true;
            _worker.WorkerSupportsCancellation = true;
            _job    = job;
            _status = new JobStatus();
            _logger = new BasicLogger();

            AssemblyVersionInfo vInfo = new AssemblyVersionInfo(typeof(JobBase));

            _logger.WriteLogMessage(String.Format("*** {0} {1}.{2} - (build {3})", vInfo.Title, vInfo.Version.Major, vInfo.Version.Minor, vInfo.LastBuildDate.ToString("yyMMdd-HHmm")), LogLevel.Info);
            _logger.WriteLogMessage(String.Format("*** Xml Schema Version {0}", D900Cdr.Schema.D900CdrDefinitionProvider.Instance.XmlVersion), LogLevel.Info);
        }
예제 #3
0
        public JobDispatcher(IDecoderJob job)
        {
            _worker                            = new BackgroundWorker();
            _worker.DoWork                    += new DoWorkEventHandler(DoJob);
            _worker.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(JobCompleted);
            _worker.ProgressChanged           += new ProgressChangedEventHandler(JobProgressChanged);
            _worker.WorkerReportsProgress      = true;
            _worker.WorkerSupportsCancellation = true;
            _job    = job;
            _status = new JobStatus();
            _logger = new BasicLogger();
            _ready  = true;

            AssemblyVersionInfo vInfo = new AssemblyVersionInfo(typeof(JobBase));

            _logger.WriteLogMessage(String.Format("*** {0} {1}.{2} - (build {3})", vInfo.Title, vInfo.Version.Major, vInfo.Version.Minor, vInfo.LastBuildDate.ToString("yyMMdd-HHmm")), LogLevel.Info);

            string[] shemas = CDR.Schema.CdrDefinitionProvider.Instance.AvailableSchemas();
            if ((shemas != null) && (shemas.Length > 0))
            {
                _logger.WriteLogMessage(String.Format("*** Definition XML Version: {0}", CDR.Schema.CdrDefinitionProvider.Instance.XmlVersion), LogLevel.Info, false);
                _logger.WriteLogMessage("*** Available Schemas:", LogLevel.Info, false);
                foreach (string s in shemas)
                {
                    _logger.WriteLogMessage(String.Format("> {0}", s), LogLevel.Info, false);
                }

                byte[] sign = CDR.Schema.CdrDefinitionProvider.Instance.AviableSignatures();
                if ((sign != null) && (sign.Length > 0))
                {
                    _logger.WriteLogMessage(String.Format("*** Available Signatures: {0}", BitConverter.ToString(sign).Replace("-", "; ")), LogLevel.Info, false);
                }
                else
                {
                    _logger.WriteLogMessage("!!! Signatures definition not found, check definition.xml", LogLevel.Error, false);
                    _ready = false;
                }
            }
            else
            {
                _logger.WriteLogMessage("!!! Schemas definition not found, check definition.xml", LogLevel.Error, false);
                _ready = false;
            }
        }
예제 #4
0
        public JobDispatcher(IDecoderJob job)
        {
            _worker = new BackgroundWorker();
            _worker.DoWork += new DoWorkEventHandler(DoJob);
            _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(JobCompleted);
            _worker.ProgressChanged += new ProgressChangedEventHandler(JobProgressChanged);
            _worker.WorkerReportsProgress = true;
            _worker.WorkerSupportsCancellation = true;
            _job = job;
            _status = new JobStatus();
            _logger = new BasicLogger();
            _ready = true;

            AssemblyVersionInfo vInfo = new AssemblyVersionInfo(typeof(JobBase));
            _logger.WriteLogMessage(String.Format("*** {0} {1}.{2} - (build {3})", vInfo.Title, vInfo.Version.Major, vInfo.Version.Minor, vInfo.LastBuildDate.ToString("yyMMdd-HHmm")), LogLevel.Info);

            string[] shemas = CDR.Schema.CdrDefinitionProvider.Instance.AvailableSchemas();
            if ((shemas != null) && (shemas.Length > 0))
            {
                _logger.WriteLogMessage(String.Format("*** Definition XML Version: {0}", CDR.Schema.CdrDefinitionProvider.Instance.XmlVersion), LogLevel.Info, false);
                _logger.WriteLogMessage("*** Available Schemas:", LogLevel.Info, false);
                foreach (string s in shemas)
                {
                    _logger.WriteLogMessage(String.Format("> {0}", s), LogLevel.Info, false);
                }

                byte[] sign = CDR.Schema.CdrDefinitionProvider.Instance.AviableSignatures();
                if ((sign != null) && (sign.Length > 0))
                {
                    _logger.WriteLogMessage(String.Format("*** Available Signatures: {0}", BitConverter.ToString(sign).Replace("-", "; ")), LogLevel.Info, false);
                }
                else
                {
                    _logger.WriteLogMessage("!!! Signatures definition not found, check definition.xml", LogLevel.Error, false);
                    _ready = false;
                }
            }
            else
            {
                _logger.WriteLogMessage("!!! Schemas definition not found, check definition.xml", LogLevel.Error, false);
                _ready = false;
            }
        }