Example #1
0
 public void RemoveCurrentField(string fieldName)
 {
     if (CurrentColumns.Count == 1 && CurrentColumns.First().FieldName == fieldName)
     {
         ApplicationController.UserMessage("There Must Be At Least One View Column");
     }
     else
     {
         //if removed field active for the current selected link then add it as an option
         if ((!fieldName.Contains(".") && SelectedLink.Key == RecordType) ||
             (fieldName.Contains(".") && fieldName.Split('.')[0] == SelectedLink.Key))
         {
             var selectedResults = CurrentColumns.Where(c => c.FieldName == fieldName).ToArray();
             foreach (var result in selectedResults)
             {
                 CurrentColumns.Remove(result);
                 foreach (var item in SelectableColumns)
                 {
                     if (item.FieldLabel != null && item.FieldLabel.CompareTo(result.FieldLabel) > 0)
                     {
                         SelectableColumns.Insert(SelectableColumns.IndexOf(item), result);
                         break;
                     }
                 }
                 if (!SelectableColumns.Contains(result))
                 {
                     SelectableColumns.Add(result);
                 }
             }
         }
     }
 }
 public void RemoveCurrentField(string fieldName)
 {
     if (CurrentColumns.Count == 1 && CurrentColumns.First().FieldName == fieldName)
     {
         ApplicationController.UserMessage("The Must Be At Least One View Column");
     }
     else
     {
         var selectedResults = CurrentColumns.Where(c => c.FieldName == fieldName).ToArray();
         foreach (var result in selectedResults)
         {
             CurrentColumns.Remove(result);
             foreach (var item in SelectableColumns)
             {
                 if (item.FieldLabel != null && item.FieldLabel.CompareTo(result.FieldLabel) > 0)
                 {
                     SelectableColumns.Insert(SelectableColumns.IndexOf(item), result);
                     break;
                 }
             }
             if (!SelectableColumns.Contains(result))
             {
                 SelectableColumns.Add(result);
             }
         }
     }
 }
Example #3
0
 public void AddCurrentItem(SelectableColumn draggedItem, SelectableColumn target = null, bool isAfter = true)
 {
     DoOnMainThread(() =>
     {
         SelectableColumns.Remove(draggedItem);
         CurrentColumns.Remove(draggedItem);
         if (target != null && CurrentColumns.Contains(target))
         {
             CurrentColumns.Insert(CurrentColumns.IndexOf(target) + (isAfter ? 1 : 0), draggedItem);
         }
         else
         {
             CurrentColumns.Add(draggedItem);
         }
         RefreshIsFirstColumn();
     });
 }