Ejemplo n.º 1
0
 /*-------------------Function to edit the name and description metadata---------------*/
 public bool editMetaData(Key key, string name, string description)
 {
     try
     {
         if (db.Contains(key))
         {
             dynamic elem1 = db.getValueOfKey(key);
             elem1.name  = name;
             elem1.descr = description;
             return(true);
         }
         else
         {
             WriteLine("\nKey is not present in the dictionary\n");
             return(false);
         }
     }
     catch (Exception e)
     {
         WriteLine("\n" + e.Message + "\n");
         return(false);
     }
 }
Ejemplo n.º 2
0
 /*-------------------Get the chidren of a particular key-----------------*/
 public List <Key> getChildrenOfKey(Key key)
 {
     try
     {
         if (db.Contains(key))
         {
             dynamic elem1 = db.getValueOfKey(key);
             return(elem1.children);
         }
         else
         {
             WriteLine("\nKey is not present in the dictionary\n");
             return(default(List <Key>));
         }
     }
     catch (Exception e)
     {
         WriteLine("\n" + e.Message + "\n");
         return(default(List <Key>));
     }
 }