private void OnVisibilityChanged(object?sender, bool mouseEnter) { Dispatcher.InvokeAsync(() => { var myWindow = ReferenceEquals(sender, Window.GetWindow(this)); var hidden = _context != null && sender switch { BuffWindow _ => App.Settings.BuffWindowSettings.Hidden.Contains(_context.Abnormality.Id) && myWindow, GroupWindow _ => App.Settings.GroupWindowSettings.Hidden.Contains(_context.Abnormality.Id) && myWindow, _ => false }; if (!myWindow) { return; } if (mouseEnter) { Visibility = Visibility.Visible; } else { if (hidden) { Visibility = Visibility.Collapsed; } } }); }
private void OnIconClickHandler() { if (_groupWindow == null) { _groupWindow = new GroupWindow <ILightArrayConfig>(LightConfig); _groupWindow.AllLightConfigReloaded += (sender, e) => { LightConfig.Destroy(); // not perfect.. LoadConfig(); _groupWindow.SetVisible(false); _groupWindow = null; AllLightConfigReloaded(this, e); }; _groupWindow.AllLightConfigSaved += (sender, e) => SaveConfig(); _groupWindow.SetVisible(true); } else { _groupWindow.ToggleVisible(); } if ((LightConfig != null && !LightConfig.UseBlizzy78Toolbar) || !ToolbarManager.ToolbarAvailable) { // Don't lock highlight on the button since it's just a toggle _appButtonStock.SetFalse(false); } }
private static void LoadWindows() { //waiting = true; //foreach (var del in WindowLoadingDelegates) //{ // waiting = true; // del.DynamicInvoke(); // while (waiting) { } //} GroupWindow = new GroupWindow(); CooldownWindow = new CooldownWindow(); BossWindow = new BossWindow(); BuffWindow = new BuffWindow(); CharacterWindow = new CharacterWindow(); ClassWindow = new ClassWindow(); InfoWindow = new InfoWindow(); FlightDurationWindow = new FlightDurationWindow(); LfgListWindow = new LfgListWindow(); SkillConfigWindow = new SkillConfigWindow(); GroupAbnormalConfigWindow = new GroupAbnormalConfigWindow(); CivilUnrestWindow = new CivilUnrestWindow(); FloatingButton = new FloatingButtonWindow(); ChatWindowManager.Instance.InitWindows(); //GroupWindow.Show(); //CooldownWindow.Show(); //BossWindow.Show(); //BuffWindow.Show(); //CharacterWindow.Show(); //ClassWindow.Show(); }
private void ClickAdd(object sender, RoutedEventArgs e) { GroupWindow groupWindow = new GroupWindow { Owner = ((MainWindow)Application.Current.MainWindow) }; if (true == groupWindow.ShowDialog()) { this.fetchData(); } }
private void OnIconClickHandler() { if (_groupWindow == null) { _groupWindow = new GroupWindow <ILightArrayConfig>(LightConfig); _groupWindow.SetVisible(true); } else { _groupWindow.ToggleVisible(); } }
private void Addgroup() { GroupViewModel gvm = new GroupViewModel(); GroupWindow window = new GroupWindow { DataContext = gvm }; gvm.OnRequestClose += (s, e) => window.Close(); window.ShowDialog(); }
private void ClickEdit(object sender, RoutedEventArgs e) { if (GroupListBox.SelectedItem != null) { GroupWindow groupWindow = new GroupWindow((Models.Group)GroupListBox.SelectedItem) { Owner = ((MainWindow)Application.Current.MainWindow) }; if (true == groupWindow.ShowDialog()) { this.fetchData(); } } }
public AddGroup(GroupWindow Window, Group group) { InitializeComponent(); GW = Window; Groups = group; Edit = true; AddCombo(); if (Edit == true) { TB_Title.Text = "Группа редактирование"; TB_TitleG.Text = Groups.Title; CB_Curator.SelectedItem = Groups.CuratorID - 1; } }
protected virtual void Dispose(bool disposing) { LightConfig.Destroy(); if (toolbarControl != null) { toolbarControl.OnDestroy(); GameObject.Destroy(toolbarControl); } if (_groupWindow != null) { _groupWindow.SetVisible(false); _groupWindow = null; } }
private void OnIconClickHandler() { if (_groupWindow == null) { _groupWindow = new GroupWindow <ILightArrayConfig>(LightConfig); _groupWindow.AllLightConfigSaved += (sender, e) => SaveConfig(e); _groupWindow.SetVisible(true); } else { _groupWindow.ToggleVisible(); } toolbarControl.SetFalse(false); }
private void EditGroupButton_Click(object sender, RoutedEventArgs e) { if (_groupNow != null && _groups.Any()) { GroupWindow window = new GroupWindow(_groups, groupsNameComboBox.Text); if ((bool)window.ShowDialog()) { InitializeGroupComboBoxContent(); OnActualGroup(); } } else { WriteMessage(BasicTextMessages.IfEmptyItemTryChange, Colors.Red); } }
private void AddGroupButton_Click(object sender, RoutedEventArgs e) { GroupWindow window = new GroupWindow(_groups); if ((bool)window.ShowDialog()) { InitializeGroupComboBoxContent(); if (_groupNow == null) { _groupNow = _groups[0]; } OnActualGroup(); } }
private static void LoadGroupWindow() { var groupWindowThread = new Thread(new ThreadStart(() => { SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher)); GroupWindow = new GroupWindow(); GroupWindow.Show(); waiting = false; Dispatcher.Run(); })); groupWindowThread.Name = "Group window thread"; groupWindowThread.SetApartmentState(ApartmentState.STA); groupWindowThread.Start(); Debug.WriteLine("Group window loaded"); }
protected virtual void Dispose(bool disposing) { LightConfig.Destroy(); if (_blizzy78Button != null) { _blizzy78Button.Destroy(); _blizzy78Button = null; } if (_appButtonStock != null) { KSP.UI.Screens.ApplicationLauncher.Instance.RemoveModApplication(_appButtonStock); _appButtonStock = null; } if (_groupWindow != null) { _groupWindow.SetVisible(false); _groupWindow = null; } }
private static void LoadGroupWindow() { var groupWindowThread = new Thread(() => { SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher)); Thread.CurrentThread.Priority = ThreadPriority.BelowNormal; GroupWindow = new GroupWindow(); if (GroupWindow.WindowSettings.Enabled) { GroupWindow.Show(); } AddDispatcher(Thread.CurrentThread.ManagedThreadId, Dispatcher.CurrentDispatcher); Dispatcher.Run(); RemoveDispatcher(Thread.CurrentThread.ManagedThreadId); }) { Name = "Group" }; groupWindowThread.SetApartmentState(ApartmentState.STA); groupWindowThread.Start(); }
public AddGroup(GroupWindow Window) { InitializeComponent(); AddCombo(); GW = Window; }
private void OnIconClickHandler() { if (_groupWindow == null) { _groupWindow = new GroupWindow<ILightArrayConfig>(LightConfig); _groupWindow.AllLightConfigReloaded += (sender, e) => { LightConfig.Destroy(); // not perfect.. LoadConfig(); _groupWindow.SetVisible(false); _groupWindow = null; AllLightConfigReloaded(this, e); }; _groupWindow.AllLightConfigSaved += (sender, e) => SaveConfig(); _groupWindow.SetVisible(true); } else { _groupWindow.ToggleVisible(); } if ((LightConfig != null && !LightConfig.UseBlizzy78Toolbar) || !ToolbarManager.ToolbarAvailable) { // Don't lock highlight on the button since it's just a toggle _appButtonStock.SetFalse(false); } }