Save&Load

There are 2 ways:

  1. Text
  2. Serialization

Method 1

Save math expression to text

  1.    using MEEL.MathTree;
  2.    
  3.     string savedString = this.mathControl1.SaveToString();
  4.    // TODO: Save to DB
  5.  

Display of the math expression from the text

  1.    // Load from DB       
  2.    string savedString = ...
  3.  
  4.    // Load and display
  5.    this.mathControl1.LoadFromString(savedString);

Method 2. Serialization

To Save

  1. byte[] data = this.mathControl1.Save();
  2. // Save data to DB
  3.  

To Load

  1. // data from DB
  2. byte[] dataFromDb = ...
  3. this.mathControl1.Load(dataFromDb);