本文整理匯總了C#中System.Script.GetNumber方法的典型用法代碼示例。如果您正苦於以下問題:C# Script.GetNumber方法的具體用法?C# Script.GetNumber怎麽用?C# Script.GetNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Script
的用法示例。
在下文中一共展示了Script.GetNumber方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DeviceEnumeration
public DeviceEnumeration(Direct3D d3d)
{
InitializeComponent();
_displayModes = new List<DisplayMode>();
_settingsScript = new Script("DisplaySettings.txt");
_adapter = d3d.GetAdapterIdentifier(0);
var allowedFormats = new[] {
Format.X1R5G5B5,
Format.A1R5G5B5,
Format.R5G6B5,
Format.X8R8G8B8,
Format.A8R8G8B8,
Format.A2R10G10B10,
};
for (var af = 0; af < allowedFormats.Length; af++) {
var format = allowedFormats[af];
var modes = d3d.GetAdapterModeCount(0, format);
for (var m = 0; m < modes; m++) {
var mode = d3d.EnumerateAdapterModes(0, format, m);
if (mode.Height < 600) continue;
var displayMode = new DisplayMode {
Mode = mode,
Bpp = af < 3 ? "16 bpp" : "32 bpp"
};
_displayModes.Add(displayMode);
}
}
txtAdapterName.Text = _adapter.Description;
txtDriverVersion.Text = _adapter.DriverVersion.ToString();
if (_settingsScript.VariableCount == 0) {
_windowed = true;
rbWindowed.Checked = true;
} else {
if (_settingsScript.GetBool("windowed")) {
_windowed = true;
rbWindowed.Checked = true;
} else {
rbFullscreen.Checked = true;
_windowed = false;
}
}
if (!_windowed) {
// enable fullscreen options
chkVSync.Enabled = true;
cbColorFormat.Enabled = true;
cbResolution.Enabled = true;
cbRefresh.Enabled = true;
chkVSync.Checked = _settingsScript.GetBool("vsync");
ResetColorFormats();
long selectedRes = _settingsScript.GetNumber("resolution");
ResetResolution(selectedRes);
long refresh = _settingsScript.GetNumber("refresh");
ResetRefresh(refresh);
}
}