/// <summary> /// When the find-user window closes, grab the rights holder that was selected and add it. /// </summary> /// <param name="sender">The find window.</param> /// <param name="eventArgs">The event arguments.</param> private void OnFindUserClose(object sender, EventArgs eventArgs) { WindowFindUser windowAddUserAccess = sender as WindowFindUser; if (windowAddUserAccess.SelectedUser != null) { DependencyObject container = null; if (!this.roles.Any(a => a.User == windowAddUserAccess.SelectedUser)) { this.roles.Add(new AccessControl(windowAddUserAccess.SelectedUser, this.Entity, AccessRight.None, this.Entity.TenantId)); this.CanApply = true; } container = this.RolesAndUsers.ItemContainerGenerator.ContainerFromItem(windowAddUserAccess.SelectedUser); if (container != null) { container.SetValue(FrameworkElement.VisibilityProperty, Visibility.Visible); } this.RolesAndUsers.SelectedItem = this.roles.FirstOrDefault(a => a.User == windowAddUserAccess.SelectedUser); this.RolesAndUsers.ScrollIntoView(this.RolesAndUsers.SelectedItem); } Win32Interop.EnableWindow(this); this.Activate(); }
/// <summary> /// Handle the edit commission schedule command. /// </summary> /// <param name="source">The edit commission schedule button.</param> /// <param name="eventArgs">The event arguments.</param> private void OnEditCommissionSchedule(object source, ExecutedRoutedEventArgs eventArgs) { WindowPaymentSchedule dialog = new WindowPaymentSchedule(); dialog.Owner = this; dialog.Entity = this.Entity as Blotter; dialog.Show(); dialog.Closed += (s, e) => Win32Interop.EnableWindow(this); Win32Interop.DisableWindow(this); }
/// <summary> /// When the find-user window closes, grab the rights holder that was selected and add it. /// </summary> /// <param name="sender">The find window.</param> /// <param name="eventArgs">The event arguments.</param> private void OnFindUserClose(object sender, EventArgs eventArgs) { WindowFindUser dialog = sender as WindowFindUser; if (dialog.SelectedUser != null) { /* * if (this.User.Groups.Contains(dialog.SelectedUser as Group)) * this.User.Groups.FirstOrDefault(g => g.Equals(dialog.SelectedUser)).Deleted = false; * else * this.User.Groups.Add(dialog.SelectedUser as Group); */ } Win32Interop.EnableWindow(this.Owner); this.Owner.Activate(); }
/// <summary> /// When the icon chooser window closes, get its selected icon (if any) and sets the entity's icon. /// </summary> /// <param name="sender">The icon chooser.</param> /// <param name="eventArgs">The event args.</param> private void OnIconChooserClosed(object sender, EventArgs eventArgs) { WindowIconChooser iconChooser = sender as WindowIconChooser; if (iconChooser.SelectedIconId != null) { this.Entity.ImageId = iconChooser.SelectedIconId.Value; this.Entity.ImageData = iconChooser.SelectedIcon.ImageData; if (!this.Populating) { this.isEntityDirty = true; } } Win32Interop.EnableWindow(this); this.Activate(); }
/// <summary> /// When the rule manager closes, re-activate the properties window. /// </summary> /// <param name="sender">The rule manager.</param> /// <param name="eventArgs">The event arguments.</param> private void OnRuleManagerClosed(object sender, EventArgs eventArgs) { Win32Interop.EnableWindow(this); this.Activate(); }