Пример #1
0
        private void Configure()
        {
            foreach (Object param in v_configurator.Properties.Keys)
            {
                switch (param.ToString())
                {
                case "layout":
                    if (doc != null)
                    {
                        ConfigureLayout(v_configurator.Properties[param], doc);
                    }
                    else
                    {
                        ConfigureLayout(v_configurator.Properties[param], null);
                    }
                    break;

                case "append":
                    if (v_configurator.Properties[param].ToString().ToLower().CompareTo("false") == 0)
                    {
                        v_append = false;
                    }
                    break;

                case "MaxFileSize":
                    long.TryParse(v_configurator.Properties[param].ToString(), out MaxFileSize);
                    break;

                case "filename":
                    v_filename = v_configurator.Properties[param].ToString();
                    break;

                case "name":
                    v_name = v_configurator.Properties[param].ToString();
                    break;

                default:
                    break;
                }
            }
            try
            {
                InitWriterStream();

                IMassNotifier massnotifier = this as IMassNotifier;
                if (massnotifier != null)
                {
                    massnotifier.Start();
                }

                //IMassAppender massappender = Layout as IMassAppender;
                //if (massappender != null)
                //   this.AppendHandler = massappender.MassAppend;
            }
            catch (Exception e) { }
        }
Пример #2
0
        public LogWriter(IMassNotifier massLog)
        {
            this.v_massLog = massLog;

            /*
             * sizer = new BackgroundWorker();
             * sizer.DoWork += new DoWorkEventHandler(sizer_DoWork);
             * sizer.RunWorkerCompleted += new RunWorkerCompletedEventHandler(sizer_RunWorkerCompleted);
             */
        }