public void LoadConfig(string configDir)
        {
            string configPath = configDir + "\\csvcolumnizer.dat";

            if (!File.Exists(configPath))
            {
                this.config = new CsvColumnizerConfig();
                this.config.InitDefaults();
            }
            else
            {
                Stream          fs        = File.OpenRead(configPath);
                BinaryFormatter formatter = new BinaryFormatter();
                try
                {
                    this.config = (CsvColumnizerConfig)formatter.Deserialize(fs);
                }
                catch (SerializationException e)
                {
                    MessageBox.Show(e.Message, "Deserialize");
                    this.config = new CsvColumnizerConfig();
                    this.config.InitDefaults();
                }
                finally
                {
                    fs.Close();
                }
            }
        }
Beispiel #2
0
    public void LoadConfig(string configDir)
    {
      string configPath = configDir + "\\csvcolumnizer.dat";

      if (!File.Exists(configPath))
      {
        this.config = new CsvColumnizerConfig();
        this.config.InitDefaults();
      }
      else
      {
        Stream fs = File.OpenRead(configPath);
        BinaryFormatter formatter = new BinaryFormatter();
        try
        {
          this.config = (CsvColumnizerConfig)formatter.Deserialize(fs);
        }
        catch (SerializationException e)
        {
          MessageBox.Show(e.Message, "Deserialize");
          this.config = new CsvColumnizerConfig();
          this.config.InitDefaults();
        }
        finally
        {
          fs.Close();
        }
      }
    }
 public CsvColumnizerConfigDlg(CsvColumnizerConfig config)
 {
   this.config = config;
   InitializeComponent();
   fillValues();
 }
Beispiel #4
0
 public CsvColumnizerConfigDlg(CsvColumnizerConfig config)
 {
     this.config = config;
     InitializeComponent();
     fillValues();
 }