Esempio n. 1
0
 static public bool AddEscolhido(string chave, string codEscolhido)
 {
     try
     {
         if ((chave != null) && (!chave.Equals("")) && (codEscolhido != null) && (!codEscolhido.Equals("")))
         {
             if (codEscolhido.Length <= VALOR_SIZE)
             {
                 StringByteArPair sbp = new StringByteArPair(codEscolhido, null);
                 dict.Add(chave, sbp);
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 2
0
 static public bool AddToDict(string k, int codeSize, int quantSpecial, int quantNumerical)
 {
     try
     {
         string           s   = GenCode(codeSize, quantSpecial, quantNumerical);
         StringByteArPair sbp = new StringByteArPair(s, null);
         dict.Add(k, sbp);
         return(true);
     }
     catch (ArgumentException)
     {
         return(false);
     }
 }