Example #1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            IgnorFields igf = comboBox1.SelectedItem as IgnorFields;

            if (igf != null)
            {
                listBox1.Items.AddRange(IgnoreService.Instance(Core).GetFilters(igf.Field));
            }
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            IgnorFields igf = comboBox1.SelectedItem as IgnorFields;

            if (igf != null && listBox1.SelectedItem != null)
            {
                IgnoreService.Instance(Core).RemoveFilter(igf.Field, listBox1.SelectedItem.ToString());
                listBox1.Items.Remove(listBox1.SelectedItem);
            }
        }
Example #3
0
        public void AddCodes(List <string> codes)
        {
            IgnoreService.Instance(Core).AddCodes(codes);
            IgnorFields igf = comboBox1.SelectedItem as IgnorFields;

            if (igf != null && this.Visible && igf.Field == IgnoreService.FilterField.GeocacheCode)
            {
                comboBox1_SelectedIndexChanged(this, EventArgs.Empty);
            }
        }
Example #4
0
 public static IgnoreService Instance(Framework.Interfaces.ICore core)
 {
     if (_uniqueInstance == null)
     {
         lock (_lockObject)
         {
             if (_uniqueInstance == null)
             {
                 _uniqueInstance = new IgnoreService(core);
             }
         }
     }
     return(_uniqueInstance);
 }
Example #5
0
        public void AddFilter(IgnoreService.FilterField field, string text)
        {
            string[] filters = IgnoreService.Instance(Core).GetFilters(field);
            string   cs      = (from s in filters where string.Compare(s, text, true) == 0 select s).FirstOrDefault();

            if (string.IsNullOrEmpty(cs))
            {
                IgnoreService.Instance(Core).AddFilter(field, field == IgnoreService.FilterField.GeocacheCode ? text.ToUpper() : text);
                IgnorFields igf = comboBox1.SelectedItem as IgnorFields;
                if (igf != null && this.Visible && igf.Field == field)
                {
                    comboBox1_SelectedIndexChanged(this, EventArgs.Empty);
                }
            }
        }
Example #6
0
 private void button3_Click(object sender, EventArgs e)
 {
     IgnoreService.Instance(Core).Clear();
     comboBox1_SelectedIndexChanged(this, EventArgs.Empty);
 }
Example #7
0
 public List <string> FilterGeocaches(List <string> codes)
 {
     return(IgnoreService.Instance(Core).FilterGeocaches(codes));
 }
Example #8
0
 public bool IgnoreGeocache(Framework.Data.Geocache gc)
 {
     return(IgnoreService.Instance(Core).IgnoreGeocache(gc));
 }
Example #9
0
 public bool IgnoreGeocache(string code)
 {
     return(IgnoreService.Instance(Core).IgnoreGeocache(code));
 }
Example #10
0
 public static IgnoreService Instance(Framework.Interfaces.ICore core)
 {
     if (_uniqueInstance == null)
     {
         lock (_lockObject)
         {
             if (_uniqueInstance == null)
             {
                 _uniqueInstance = new IgnoreService(core);
             }
         }
     }
     return _uniqueInstance;
 }
Example #11
0
 public IgnorFields(IgnoreService.FilterField field, string text)
 {
     Field = field;
     Text = text;
 }
Example #12
0
 public void AddFilter(IgnoreService.FilterField field, string text)
 {
     string[] filters = IgnoreService.Instance(Core).GetFilters(field);
     string cs = (from s in filters where string.Compare(s, text, true) == 0 select s).FirstOrDefault();
     if (string.IsNullOrEmpty(cs))
     {
         IgnoreService.Instance(Core).AddFilter(field, field == IgnoreService.FilterField.GeocacheCode ? text.ToUpper() : text);
         IgnorFields igf = comboBox1.SelectedItem as IgnorFields;
         if (igf != null && this.Visible && igf.Field == field)
         {
             comboBox1_SelectedIndexChanged(this, EventArgs.Empty);
         }
     }
 }