public bool Add(HipTypeString hip) { bool retval = false; try { using (StreamWriter sw = new StreamWriter(_hipPath, true, Encoding.UTF8)) { sw.Write(hip.Key); sw.Write(HipSeparator); sw.WriteLine(hip.Value); } //if success write to file, return true that indicate all ok. retval = true; } catch (IOException ex) { //Indicate that have problem; retval = false; //Log error //throw ex; Console.WriteLine(ex); } return retval; }
public bool AddData(HipTypeString value) { if (value == null) throw new ArgumentNullException("Value not set"); Hip hip = new Hip(); return hip.Add(value); }
public bool UpdateData(HipTypeString value) { return string.IsNullOrEmpty(value.Value) ? false : true; }