private void Double_OnClick(object sender, MouseButtonEventArgs e)
 {
     if (ltw == null)
     {
         ltw                          = new LandmarkTypeWindow(map, this);
         forChanging                  = (LandmarkType)dgrTypes.SelectedItem;
         changing                     = true;
         ltw.LTID_Field.Text          = forChanging.ID;
         ltw.LTName_Field.Text        = forChanging.Name;
         ltw.LTDescription_Field.Text = forChanging.Description;
         ltw.Image_Path               = forChanging.IconPath;
         ltw.Show();
         if (tempLT != null)
         {
             if (forChanging.Equals(tempLT))
             {
                 LTID.Text = "";
                 tempLT    = null;
             }
         }
     }
     else
     {
         ltw.Topmost = true;  // important
         ltw.Topmost = false; // important
         ltw.Focus();         // important
     }
 }
        public bool AddType(LandmarkType lt)
        {
            if (ptypes.Contains(lt) && changing == false)
            {
                return(false);
            }

            if (changing == true)
            {
                if (lt.Equals(forChanging))
                {
                }
                else
                {
                    ptypes.Remove(forChanging);
                    ltypes.Remove(forChanging);
                    ptypes.Add(lt);
                    ltypes.Add(lt);
                }
            }
            else
            {
                ptypes.Add(lt);
                ltypes.Add(lt);
            }

            changing = false;
            return(true);
        }
示例#3
0
 public bool Equals(Landmark l)
 {
     return(_id.Equals(l.ID) && _name.Equals(l._name) && _desc.Equals(l._desc) &&
            _climate.Equals(l._climate) && _dd.Equals(l._dd) && _ee.Equals(l._ee) &&
            _hab.Equals(l._hab) && _lt.Equals(l._lt) && _rev == l._rev &&
            _status.Equals(l._status) && _tags.Equals(l._tags) &&
            _urb.Equals(l._urb));
 }
        private void SelectionChanged_OnClick(object sender, SelectionChangedEventArgs e)
        {
            LandmarkType ltt = (LandmarkType)dgrTypes.SelectedItem;

            if (tempLT != null)
            {
                if (ltt.Equals(tempLT))
                {
                    Select.Content = "Deselect";
                }
                else
                {
                    Select.Content = "Select";
                }
            }
            else
            {
                Select.Content = "Select";
            }
        }