示例#1
0
 /// <summary>
 /// Adds a property to AddIndexPropertyCollection.
 /// </summary>
 /// <param name="propertyName">Name of the property.</param>
 /// <param name="propertyValue">Value of the property.</param>
 /// <returns><c>true</c> if the addition was successful; otherwise, <c>false</c></returns>
 public bool AddToAddIndexPropertyCollection(string propertyName, byte[] propertyValue)
 {
     try
     {
         if (DeleteIndexPropertyCollection.Contains(propertyName))
         {
             return(false);
         }
         AddIndexPropertyCollection.Add(propertyName, propertyValue);
     }
     catch (ArgumentException)
     {
         //Silently fail if the key already exists
         return(false);
     }
     return(true);
 }
示例#2
0
 /// <summary>
 /// Adds a property to DeleteIndexPropertyCollection.
 /// </summary>
 /// <param name="propertyName">Name of the property.</param>
 /// <returns><c>true</c> if the addition was successful; otherwise, <c>false</c></returns>
 public bool AddToDeleteIndexPropertyCollection(string propertyName)
 {
     try
     {
         if (AddIndexPropertyCollection.ContainsKey(propertyName))
         {
             //take it out of add list and add it to the delete list
             AddIndexPropertyCollection.Remove(propertyName);
         }
         DeleteIndexPropertyCollection.Add(propertyName);
     }
     catch (ArgumentException)
     {
         //Silently fail if the key already exists
         return(false);
     }
     return(true);
 }