Пример #1
0
        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;
        }
Пример #2
0
        public bool AddData(HipTypeString value)
        {
            if (value == null)
            throw new ArgumentNullException("Value not set");

              Hip hip = new Hip();
              return hip.Add(value);
        }
Пример #3
0
 public bool UpdateData(HipTypeString value)
 {
     return string.IsNullOrEmpty(value.Value) ? false : true;
 }