예제 #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (SelectedCollection != null)
     {
         Settings.Settings.Default.DeleteGeocacheCollection(SelectedCollection.CollectionID);
         AvailableCollections.Remove(SelectedCollection);
     }
 }
예제 #2
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (SelectedCollection != null && AvailableCollections.Contains(SelectedCollection))
     {
         Core.Settings.Default.DeleteCollection(SelectedCollection);
         AvailableCollections.Remove(SelectedCollection);
     }
 }
예제 #3
0
        public IQueryable <T> Collection <T>(string collectionName = null)
        {
            collectionName ??= typeof(T).Name;

            if (!AvailableCollections.Contains(collectionName))
            {
                throw new NotSupportedException($"The collection {collectionName} is not available in this context");
            }

            return(Connector.ReadOnlyCollection <T>(SessionId, collectionName));
        }
예제 #4
0
 private void newDialog_DialogClosed(object sender, EventArgs e)
 {
     inputDialog.DialogClosed -= newDialog_DialogClosed;
     if (inputDialog.DialogResult)
     {
         if (!string.IsNullOrEmpty(inputDialog.InputText))
         {
             string s = inputDialog.InputText.Trim();
             if (s.Length > 0)
             {
                 int id = Core.Settings.Default.GetCollectionID(s);
                 if (id < 0)
                 {
                     Core.Settings.Default.AddCollection(s);
                     AvailableCollections.Add(s);
                     SelectedCollection = s;
                 }
             }
         }
     }
 }
예제 #5
0
 private void newDialog_DialogClosed(object sender, EventArgs e)
 {
     inputDialog.DialogClosed -= newDialog_DialogClosed;
     if (inputDialog.DialogResult)
     {
         if (!string.IsNullOrEmpty(inputDialog.InputText))
         {
             string s = inputDialog.InputText.Trim();
             if (s.Length > 0)
             {
                 var c = Settings.Settings.Default.GetCollection(s);
                 if (c == null)
                 {
                     c = Settings.Settings.Default.GetCollection(s, createIfNotExists: true);
                     if (c != null)
                     {
                         AvailableCollections.Add(c);
                         SelectedCollection = c;
                     }
                 }
             }
         }
     }
 }
예제 #6
0
        public bool CanMoveDown(CommentsCollection _collection)
        {
            int index = AvailableCollections.IndexOf(_collection);

            return((index != -1) && (index != AvailableCollections.Count - 1));
        }
예제 #7
0
        public bool CanMoveUp(CommentsCollection _collection)
        {
            int index = AvailableCollections.IndexOf(_collection);

            return(index > 0);
        }