示例#1
0
 private void PerformAdd()
 {
     try
     {
         if (_selectedList != null)
         {
             Model.IINIKeyValuePair newItem = null;
             var listValue = _selectedList.InvokeMethod("CreateNewItem") as List <string>;
             if (listValue == null)
             {
                 newItem = CreateNewItem();
                 _selectedList.Add(newItem);
                 _selectedList.UpdateIndex();
             }
             else if (listValue.Count > 0)
             {
                 foreach (var item in listValue)
                 {
                     newItem          = CreateNewItem();
                     newItem.IniValue = item;
                     _selectedList.Add(newItem);
                     _selectedList.UpdateIndex();
                 }
             }
             FireValuePropertyValueChanged();
         }
     }
     catch (Exception e)
     {
         this.DisplayError(e);
     }
     UpdateUI();
 }
示例#2
0
 private void PerformAdd()
 {
     try
     {
         Model.IINIKeyValuePair newItem = CreateNewItem();
         if (_selectedList != null)
         {
             _selectedList.Add(newItem);
         }
         _selectedList.UpdateIndex();
         FireValuePropertyValueChanged();
     }
     catch (Exception e)
     {
         this.DisplayError(e);
     }
     UpdateUI();
 }