protected void UpdatePinnedRoute(string context, string name, NPANXXValue condition, string pinsetName)
 {
     lock (_lock)
     {
         Hashtable ht = StoredConfiguration;
         Hashtable routes = (Hashtable)ht[_SCONFIG_ROUTES_NAME];
         ArrayList cont = new ArrayList();
         if (routes.ContainsKey(context))
         {
             cont = (ArrayList)routes[context];
             routes.Remove(context);
         }
         Hashtable pr;
         int index = cont.Count;
         for (int x = 0; x < cont.Count; x++)
         {
             pr = (Hashtable)cont[x];
             if ((string)pr[_NAME_FIELD_ID] == name)
             {
                 index = x;
                 cont.RemoveAt(x);
                 break;
             }
         }
         pr = new Hashtable();
         pr.Add(_NAME_FIELD_ID, name);
         pr.Add(_NPA_FIELD_ID, condition.Value);
         pr.Add(_PIN_SET_NAME_FIELD_ID, pinsetName);
         cont.Insert(index, pr);
         routes.Add(context, cont);
         ht.Remove(_SCONFIG_ROUTES_NAME);
         ht.Add(_SCONFIG_ROUTES_NAME, routes);
         StoredConfiguration = ht;
     }
 }
Exemple #2
0
        public int CompareTo(object obj)
        {
            NPANXXValue npv = (NPANXXValue)obj;

            return(_value.CompareTo(npv.Value));
        }
 protected void AddPinnedRoute(string context, string name, NPANXXValue condition, string pinsetName)
 {
     lock (_lock)
     {
         Hashtable ht = StoredConfiguration;
         Hashtable routes = (Hashtable)ht[_SCONFIG_ROUTES_NAME];
         ArrayList cont = new ArrayList();
         if (routes.ContainsKey(context))
         {
             cont = (ArrayList)routes[context];
             routes.Remove(context);
         }
         Hashtable pr = new Hashtable();
         pr.Add(_NAME_FIELD_ID, name);
         pr.Add(_NPA_FIELD_ID, condition.Value);
         pr.Add(_PIN_SET_NAME_FIELD_ID, pinsetName);
         cont.Add(pr);
         routes.Add(context, cont);
         ht.Remove(_SCONFIG_ROUTES_NAME);
         ht.Add(_SCONFIG_ROUTES_NAME, routes);
         StoredConfiguration = ht;
     }
 }