Пример #1
0
        public void LoadConfig(string configDir)
        {
            string configPath = configDir + "\\log4jxmlcolumnizer.dat";

            if (!File.Exists(configPath))
            {
                this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
            }
            else
            {
                Stream          fs        = File.OpenRead(configPath);
                BinaryFormatter formatter = new BinaryFormatter();
                try
                {
                    this.config = (Log4jXmlColumnizerConfig)formatter.Deserialize(fs);
                    if (this.config.columnList.Count < Log4jXmlColumnizer.COLUMN_COUNT)
                    {
                        this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
                    }
                }
                catch (SerializationException e)
                {
                    MessageBox.Show(e.Message, "Deserialize");
                    this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
                }
                finally
                {
                    fs.Close();
                }
            }
        }
 public Log4jXmlColumnizerConfigDlg(Log4jXmlColumnizerConfig config)
 {
   this.config = config;
   InitializeComponent();
   FillListBox();
   this.localTimeCheckBox.Checked = this.config.localTimestamps;
 }
 public Log4jXmlColumnizerConfigDlg(Log4jXmlColumnizerConfig config)
 {
     this.config = config;
     InitializeComponent();
     FillListBox();
     this.localTimeCheckBox.Checked = this.config.localTimestamps;
 }
Пример #4
0
 public Log4jXmlColumnizer()
 {
     config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
 }
Пример #5
0
    public void LoadConfig(string configDir)
    {
      string configPath = configDir + "\\log4jxmlcolumnizer.dat";

      if (!File.Exists(configPath))
      {
        this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
      }
      else
      {
        Stream fs = File.OpenRead(configPath);
        BinaryFormatter formatter = new BinaryFormatter();
        try
        {
          this.config = (Log4jXmlColumnizerConfig)formatter.Deserialize(fs);
          if (this.config.columnList.Count < Log4jXmlColumnizer.COLUMN_COUNT)
          {
            this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
          }
        }
        catch (SerializationException e)
        {
          MessageBox.Show(e.Message, "Deserialize");
          this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
        }
        finally
        {
          fs.Close();
        }
      }
    }
Пример #6
0
 public Log4jXmlColumnizer()
 {
   config = new Log4jXmlColumnizerConfig(GetAllColumnNames());
 }