Example #1
0
 public UsersView()
 {
     this.SelectionMode     = ListViewItemsSelectionMode.Single;
     this.SelectionChanged += (o, e) => {
         SelectedUserChanged?.Invoke(this, new EventsArgs <IGeolocationTarget>(this.SelectedUser));
     };
 }
Example #2
0
        public LocationsView()
        {
            InitializeComponent();
            bool ignoreUserNavigation = false;

            usersView.SelectedUserChanged += (o, e) => {
                if (usersView.SelectedUser != null)
                {
                    devicesView.Devices = usersView.SelectedUser
                                          .Geolocations
                                          .Select(x => x.Device)
                                          .Distinct()
                                          .ToArray();
                }
                else
                {
                    devicesView.Devices = new string[0];
                }
                SelectedUserChanged?.Invoke(this, new EventsArgs <IGeolocationTarget>(SelectedUser));
                devicesView.SelectedDevice = devicesView.Devices.FirstOrDefault();
            };
            devicesView.SelectedDeviceChanged += (o, e) => {
                if (!ignoreUserNavigation && SelectedUser != null)
                {
                    locationsView.NavigateTo(SelectedUser.Name, SelectedDevice);
                }
                SelectedDeviceChanged?.Invoke(this, new EventsArgs <string>(SelectedDevice));
                HideDevicesExcept(e.Value);
            };
            locationsView.UserNavigated += (o, e) => {
                ignoreUserNavigation       = true;
                usersView.SelectedUser     = usersView.Users.FirstOrDefault(x => x.Id == e.Value.UserId);
                devicesView.SelectedDevice = e.Value.DeviceId;
                ignoreUserNavigation       = false;
            };
            locationsView.SelectedPlaceChanged += (o, e) => SelectedPlaceChanged?.Invoke(this, e);

            this.Loaded += (o, e) => FitToMarkers();
        }
Example #3
0
 public void SetSelectedUser(User user)
 {
     _selectedUser = user;
     SelectedUserChanged?.Invoke(this, user);
 }
 protected override void OnSelectedItemChanged()
 {
     _selectedUser = (GABUser)SelectedItem?.Item;
     // If the tab key was used to select, the user wants to click open
     SelectedUserChanged?.Invoke(this, new SelectedUserEventArgs(_selectedUser, GetCommitSource() != CommitSource.KeyTab));
 }
 protected override void OnTextChanged(EventArgs e)
 {
     base.OnTextChanged(e);
     _selectedUser = string.IsNullOrEmpty(Text) ? null : new GABUser(Text);
     SelectedUserChanged?.Invoke(this, new SelectedUserEventArgs(_selectedUser, false));
 }
Example #6
0
 private void Combobox1_TextChanged(object sender, EventArgs e)
 {
     SelectedUserChanged?.Invoke();
 }
 public void OnSelectedUserChanged(User user)
 {
     SelectedUserChanged?.Invoke(this, new UserChangedEventArgs(user));
 }