public Hub(Func<HubState> restoreStateHandler, Action<HubState> saveStateHandler) { if (restoreStateHandler == null) throw new ArgumentNullException ("restoreStateHandler"); if (saveStateHandler == null) throw new ArgumentNullException ("saveStateHandler"); save_state_handler = saveStateHandler; state = restoreStateHandler (); }
void Save(HubState state) { using (var xw = XmlWriter.Create (store_file_name)) serializer.WriteObject (xw, state); }