Example #1
0
        /// <summary>
        /// Throws PersistenceStateSerializationException
        /// </summary>
        public void Serialize()
        {
            PersistentState state = new PersistentState();

            OnSerialize?.Invoke(state);
            saveToFile(state);
        }
Example #2
0
        /// <summary>
        /// Throws PersistenceStateSerializationException
        /// </summary>
        public void Serialize()
        {
            PersistentState state = new PersistentState();

            try
            {
                OnSerialize?.Invoke(state);
                saveToFile(state);
            }
            catch (Exception ex)
            {
                throw new PersistenceStateSerializationException("Cannot serialize state", ex);
            }
        }
 public XmlAdapter(string[] columnHeaders, OnDeserialize onDeserialize, OnSerialize onSerialize)
 {
     this.columnHeaders = columnHeaders;
     this.onDeserialize = onDeserialize;
     this.onSerialize   = onSerialize;
 }