GetString() public method

Retrieves a string of the tox key.
public GetString ( ) : string
return string
Example #1
0
        public bool Delete(ToxKey publicKey)
        {
            string avatarFilename = Path.Combine(Dir, publicKey.GetString() + ".png");
            if (File.Exists(avatarFilename))
            {
                try { File.Delete(avatarFilename); }
                catch { return false; }

                return true;
            }
            else
            {
                return false;
            }
        }
Example #2
0
        private byte[] LoadBytes(ToxKey publicKey)
        {
            try
            {
                string avatarFilename = Path.Combine(Dir, publicKey.GetString() + ".png");
                if (File.Exists(avatarFilename))
                {
                    byte[] bytes = File.ReadAllBytes(avatarFilename);
                    if (bytes.Length > 0)
                        return bytes;
                }

                return null;
            }
            catch { return null; }
        }
Example #3
0
 public bool Save(byte[] img, ToxKey publicKey)
 {
     try
     {
         File.WriteAllBytes(Path.Combine(Dir, publicKey.GetString() + ".png"), img);
         return true;
     }
     catch { return false; }
 }
Example #4
0
 public bool Contains(ToxKey publicKey)
 {
     return File.Exists(Path.Combine(Dir, publicKey.GetString() + ".png"));
 }