public static void Dump() { try { UserDefinFunItem[] nodes = new UserDefinFunItem[UserFuncDic.Count]; int i = 0; foreach (KeyValuePair <string, string> pair in UserFuncDic) { nodes[i] = new UserDefinFunItem(); nodes[i].UfuncName = pair.Key; nodes[i].UfuncExpression = pair.Value; i++; } UFuncs temp = new UFuncs(); temp.Items = nodes; SerializerHelper.XMLSerialize(FILENAME, temp); } catch (Exception ex) { throw ex; } }
static void LoadUfuncs() { if (!File.Exists(FILENAME)) { //nothing } else { try { _uFuncs = SerializerHelper.XMLDeSerialize <UFuncs>(FILENAME); } catch (Exception ex) { throw ex; } if (_uFuncs != null) { foreach (UserDefinFunItem n in _uFuncs.Items) { CreateUfunc(n.UfuncName, n.UfuncExpression); } } } }
static void LoadUfuncs() { if (!File.Exists(FILENAME)) { //nothing } else { try { _uFuncs = SerializerHelper.XMLDeSerialize<UFuncs>(FILENAME); } catch (Exception ex) { throw ex; } if (_uFuncs != null) { foreach (UserDefinFunItem n in _uFuncs.Items) { CreateUfunc(n.UfuncName, n.UfuncExpression); } } } }
public static void Dump() { try { UserDefinFunItem[] nodes = new UserDefinFunItem[UserFuncDic.Count]; int i = 0; foreach (KeyValuePair<string, string> pair in UserFuncDic) { nodes[i] = new UserDefinFunItem(); nodes[i].UfuncName = pair.Key; nodes[i].UfuncExpression = pair.Value; i++; } UFuncs temp = new UFuncs(); temp.Items = nodes; SerializerHelper.XMLSerialize(FILENAME, temp); } catch (Exception ex) { throw ex; } }