本文整理汇总了C#中Settings.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.ShowDialog方法的具体用法?C# Settings.ShowDialog怎么用?C# Settings.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSettings_Click
private void btnSettings_Click(object sender, EventArgs e)
{
Settings settingsForm = new Settings();
settingsForm.Game = _game;
DialogResult result = settingsForm.ShowDialog();
if (result == DialogResult.OK) {
UpdateSettings();
}
}
示例2: OnActivate
protected override void OnActivate()
{
try
{
using (Settings form = new Settings())
{
if (DialogResult.OK == form.ShowDialog())
{
}
}
}
catch (SystemException e)
{
MessageBox.Show(e.Message);
}
finally
{
Terminate();
}
}
示例3: Initialize
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
//Get the Settings to init the game
_settings = new Settings();
// DMC - enhanced ability to exit gracefully.....
// _settings.ShowDialog();
System.Windows.Forms.DialogResult res = _settings.ShowDialog();
if (res != System.Windows.Forms.DialogResult.OK)
{
userCancelled = true;
return;
}
_settings.Show();
//Init the game
_Wumpus = new Game(_settings,this.Content,_settings.posX, _settings.posY);
//Prepare Screen
InitGraphicsMode(500, 500, false);
base.Initialize();
}
示例4: ShowSettingsDialog
public void ShowSettingsDialog()
{
var view = new Settings();
view.DataContext = this;
view.ShowDialog();
}
示例5: settingsButton_Click
private void settingsButton_Click(object sender, RoutedEventArgs e)
{
Settings settings = new Settings();
if (settings.ShowDialog() == true)
{
UserSetting.Speed = settings.getSpeed();
UserSetting.TimeLimit = settings.getTimeLimit();
UserSetting.CoverageLimit = settings.getCoverageLimit();
Console.WriteLine("Speed = " + settings.getSpeed());
Console.WriteLine("Time = " + settings.getTimeLimit());
Console.WriteLine("Coverage = " + settings.getCoverageLimit());
this.timeLimit = UserSetting.TimeLimit;
if (timeLimit > 10)
{
timeLabel.Content = string.Format("0{0}:{1}", timeLimit / 60, timeLimit % 60);
}
else
{
timeLabel.Content = string.Format("0{0}:0{1}", timeLimit / 60, timeLimit % 60);
}
this.speedLabel.Content = UserSetting.Speed.ToString();
this.displayConsoleMessage("User settings changed!");
}
}
示例6: myButton3_Click
private void myButton3_Click(object sender, EventArgs e)
{
//Settings
Settings settings = new Settings(mp3Player,mp3Path,sp,font,TIMER_GAME,isPlaying);
DialogResult settingsResult = settings.ShowDialog();
if (settingsResult == System.Windows.Forms.DialogResult.Cancel)
{
isPlaying = settings.playing;
TIMER_GAME = settings.timer;
mp3Player = settings.mp3Player;
mp3Path = settings.path;
}
}
示例7: SettingsClickEvent
private void SettingsClickEvent(object sender, RoutedEventArgs e)
{
var settings = new Settings();
settings.ShowDialog();
}
示例8: ShowSettings
public void ShowSettings(int tabindex, IWin32Window owner = null)
{
int pi = Conf.PreviewItems;
var settings = new Settings { MainClass = this, InitialTab = tabindex };
if (settings.ShowDialog(owner ?? this) == DialogResult.OK)
{
if (pi != Conf.PreviewItems)
NeedsMediaRefresh = Helper.Now;
_pnlCameras.BackColor = Conf.MainColor.ToColor();
notifyIcon1.Text = Conf.TrayIconText;
if (!string.IsNullOrEmpty(Conf.Joystick.id))
{
if (_jst == null)
{
_jst = new JoystickDevice();
}
_jst.ReleaseJoystick();
if (_tmrJoystick != null)
{
_tmrJoystick.Stop();
_tmrJoystick = null;
}
bool jsactive = false;
string[] sticks = _jst.FindJoysticks();
foreach (string js in sticks)
{
string[] nameid = js.Split('|');
if (nameid[1] == Conf.Joystick.id)
{
Guid g = Guid.Parse(nameid[1]);
jsactive = _jst.AcquireJoystick(g);
}
}
if (!jsactive)
{
_jst.ReleaseJoystick();
_jst = null;
}
else
{
_tmrJoystick = new Timer(100);
_tmrJoystick.Elapsed += TmrJoystickElapsed;
_tmrJoystick.Start();
}
}
else
{
if (_tmrJoystick != null)
{
_tmrJoystick.Stop();
_tmrJoystick = null;
}
if (_jst != null)
{
_jst.ReleaseJoystick();
_jst = null;
}
}
}
if (settings.ReloadResources)
{
RenderResources();
LoadCommands();
}
AddressIPv4 = ""; //forces reload
AddressIPv6 = "";
settings.Dispose();
SaveConfig();
Refresh();
}
示例9: settingsToolStripMenuItem_Click
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
var settings = new Settings();
settings.ShowDialog();
}
示例10: Settings
private void настройкиToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings set1 = new Settings();
set1.ShowDialog();
}
示例11: btnSettings_Click
private void btnSettings_Click(object sender, RoutedEventArgs e)
{
//Use this to open the settings page
Settings SettingsForm = new Settings(this);
SettingsForm.ShowDialog();
SettingsForm = null;
}
示例12: Window_Loaded
private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
// Check for user settings before settings up form
if (String.IsNullOrEmpty(SettingHelper.UserName)) {
Settings SettingsForm = new Settings();
SettingsForm.ShowDialog();
if (String.IsNullOrEmpty(SettingHelper.UserName))
Close();
else
Setup();
} else
Setup();
}
示例13: OnShowSettingsWindow
private void OnShowSettingsWindow(object sender, EventArgs eventArgs)
{
if (!_settingsOpen)
{
_settingsOpen = true;
var s = new Settings();
//When done changing settings, restart the observer
s.Closed += (o, args) =>
{
_settingsOpen = false;
((MainWindow) _window).ResetObserver();
};
s.ShowDialog();
}
}
示例14: btnSettings_Click
private void btnSettings_Click(object sender, RoutedEventArgs e)
{
Settings SettingsForm = new Settings();
SettingsForm.ShowDialog();
}
示例15: settingsToolStripMenuItem_Click
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
// Create a new form for editing the maze details.
Settings settings = new Settings();
settings.ShowDialog();
}