Ejemplo n.º 1
0
        public static Seed FromSeedString(string item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (!item.StartsWith("Seed:"))
            {
                throw new ArgumentException("item");
            }

            try
            {
                using (Stream stream = AmoebaConverter.FromBase64String(item.Remove(0, "Seed:".Length)))
                {
                    return(AmoebaConverter.FromStream <Seed>(stream));
                }
            }
            catch (Exception)
            {
                throw new FormatException();
            }
        }