Пример #1
0
        public static void Init()
        {
            __traceListener = new PBTraceListener();
            //__traceListener.Filter = new System.Diagnostics.EventTypeFilter(System.Diagnostics.SourceLevels.Warning);
            System.Diagnostics.Trace.Listeners.Add(__traceListener);

            //DefaultMongoSerialization.SetDefaultMongoSerializationOptions();
            //DefaultMongoSerialization.RegisterDefaultMongoSerializer();

            HtmlRun.SetResult = dt => RunSource.CurrentRunSource.SetResult(dt);
        }
Пример #2
0
        // load dll but to late to get Init method, dll is loaded only when code from dll is executed
        // used to load dll ebook.download.dll from project download.dll.project.xml
        //public static void Fake()
        //{
        //}

        public static void Init(bool traceProvider = false, bool traceSerializer = false)
        {
            __traceListener = new PBTraceListener();
            //__traceListener.Filter = new System.Diagnostics.EventTypeFilter(System.Diagnostics.SourceLevels.Warning);
            System.Diagnostics.Trace.Listeners.Add(__traceListener);

            // called from Extension_01.dll.project.xml
            //RunSerializer.InitDefault(traceProvider, traceSerializer);
            //RunSerializer.InitZValue(traceSerializer);
            //RunSerializer.InitWebHeader(traceSerializer);
        }
Пример #3
0
        public static void Init()
        {
            RunSource rs = RunSource.CurrentRunSource;

            rs.InitConfig("download");
            string log = rs.Config.GetRootSubPath("Log", null);

            if (log != null)
            {
                Trace.CurrentTrace.SetLogFile(log, LogOptions.IndexedFile);
            }
            __traceListener = new PBTraceListener();
            //__traceListener.Filter = new System.Diagnostics.EventTypeFilter(System.Diagnostics.SourceLevels.Warning);
            System.Diagnostics.Trace.Listeners.Add(__traceListener);
            string dataDir = rs.Config.GetExplicit("DataDir");

            rs.DataDir = dataDir;
            string trace = rs.Config.GetRootSubPath("Trace", null);

            if (trace != null && trace != "")
            {
                rs.Trace.SetTraceDirectory(trace);
            }
            //rs.GridResultSetDataTable += FormatResultDataTable;
            //HtmlXmlReader.CurrentHtmlXmlReader.SetResult += new SetResultEvent(rs.SetResult);
            string mongoLog = rs.Config.GetRootSubPath("MongoLog", null);

            //Trace.WriteLine("mongoLog \"{0}\"", mongoLog);
            if (mongoLog != null)
            {
                // set mongo log file
                MongoLog.CurrentMongoLog.SetLogFile(mongoLog, LogOptions.IndexedFile);
                // send mongo log file to current trace
                //MongoLog.CurrentMongoLog.Log.Writed += Trace.CurrentTrace.Write;
            }
            string mongoCache = rs.Config.GetRootSubPath("MongoCache", null);

            if (mongoCache != null)
            {
                MongoCursorCache.CacheFile = mongoCache;
            }
            //pb.Data.Mongo.TraceMongoCommand.ResultToText = true;
            pb.Data.Mongo.TraceMongoCommand.ResultToGrid = true;
            //Download.Print.RapideDdl.RapideDdl.RegisterMongoSerializer();
            DefaultMongoSerialization.SetDefaultMongoSerializationOptions();
            DefaultMongoSerialization.RegisterDefaultMongoSerializer();
            //MailSender.Trace = true;
            //Download.Print.RapideDdl.RapideDdl.Trace = true;
            //Download.Print.RapideDdl.RapideDdl_LoadPostDetailFromWebManager.Trace = true;
            //Download.Print.GoldenDdl.GoldenDdl_LoadPostDetailFromWebManager.Trace = true;
            //Download.Print.Ebookdz.Ebookdz_LoadPostDetail.Trace = true;
            //global::Print.PrintTextValuesManager.Trace = true;

            // export data of PrintTextValuesManager
            bool exportData = rs.Config.Get("TextInfos/ExportData").zParseAs <bool>();

            if (exportData)
            {
                string exportDataFile = rs.Config.Get("TextInfos/ExportDataFile");
                if (exportDataFile != null)
                {
                    DownloadPrint.PrintTextValuesManager.SetExportDataFile(exportDataFile);
                }
            }

            HtmlRun.SetResult = dt => RunSource.CurrentRunSource.SetResult(dt);
            //FindPrintManager.TraceWarning = true;
            //DebriderAlldebrid.Trace = true;
        }