Exemplo n.º 1
0
        private void OnValidateToken(object sender, TokenEditValidateTokenEventArgs e)
        {
            int id;

            if (int.TryParse(e.Description, out id))
            {
                string tok = TokenRegistry.GetToken(id);
                e.Description = tok;
                e.Value       = new ObjectWrapper(id);
                e.IsValid     = true;
            }
        }
Exemplo n.º 2
0
 void UpdateTokens(TokenEdit edit, Employee emp)
 {
     if (update)
     {
         return;
     }
     this.update = true;
     try {
         emp.Tokens.Clear();
         foreach (ObjectWrapper wr in (IList)edit.EditValue)
         {
             string tok = TokenRegistry.GetToken(wr.Obj);
             emp.Tokens.Add(tok);
         }
         gridView1.UpdateCurrentRow();
     }
     finally {
         this.update = false;
     }
 }