mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
source code checkin
This commit is contained in:
parent
5f8fb2c825
commit
7e57b72e35
675 changed files with 168433 additions and 0 deletions
66
src/ARKServerManager/Windows/ProcessorAffinityWindow.xaml.cs
Normal file
66
src/ARKServerManager/Windows/ProcessorAffinityWindow.xaml.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using ServerManagerTool.Common.Model;
|
||||
using ServerManagerTool.Common.Utils;
|
||||
using System.Numerics;
|
||||
using System.Windows;
|
||||
using WPFSharp.Globalizer;
|
||||
|
||||
namespace ServerManagerTool
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ProcessorAffinityWindow.xaml
|
||||
/// </summary>
|
||||
public partial class ProcessorAffinityWindow : Window
|
||||
{
|
||||
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
|
||||
|
||||
public static readonly DependencyProperty ProcessorAffinityListProperty = DependencyProperty.Register(nameof(ProcessorAffinityList), typeof(ProcessorAffinityList), typeof(ProcessorAffinityWindow), new PropertyMetadata(null));
|
||||
public ProcessorAffinityList ProcessorAffinityList
|
||||
{
|
||||
get { return (ProcessorAffinityList)GetValue(ProcessorAffinityListProperty); }
|
||||
set { SetValue(ProcessorAffinityListProperty, value); }
|
||||
}
|
||||
|
||||
public ProcessorAffinityWindow(string profileName, BigInteger affinityValue)
|
||||
{
|
||||
AffinityValue = affinityValue;
|
||||
|
||||
InitializeComponent();
|
||||
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
|
||||
|
||||
this.Title = string.Format(_globalizer.GetResourceString("ProcessorAffinity_ProfileTitle"), profileName);
|
||||
this.ProcessorAffinityList = new ProcessorAffinityList(affinityValue);
|
||||
|
||||
this.DataContext = this;
|
||||
}
|
||||
|
||||
public BigInteger AffinityValue
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
private void Process_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AffinityValue = this.ProcessorAffinityList.AffinityValue;
|
||||
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void SelectAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var item in ProcessorAffinityList)
|
||||
{
|
||||
item.Selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void UnselectAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var item in ProcessorAffinityList)
|
||||
{
|
||||
item.Selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue