本文整理汇总了C#中DeviceMode类的典型用法代码示例。如果您正苦于以下问题:C# DeviceMode类的具体用法?C# DeviceMode怎么用?C# DeviceMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeviceMode类属于命名空间,在下文中一共展示了DeviceMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: XForwarder
/// <summary>
/// Initializes a new instance of the <see cref="XForwarder"/> class.
/// </summary>
/// <param name="context">The <see cref="NetMQContext"/> to use when creating the sockets.</param>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public XForwarder(NetMQContext context, string frontendBindAddress, string backendBindAddress,
DeviceMode mode = DeviceMode.Threaded)
: base(context.CreateXSubscriberSocket(), context.CreateXPublisherSocket(), mode)
{
this.FrontendSetup.Bind(frontendBindAddress);
this.BackendSetup.Bind(backendBindAddress);
}
开发者ID:yonglehou,项目名称:Daytona,代码行数:14,代码来源:XForwarder.cs
示例2: DeviceBase
/// <summary>
/// Create a new instance of the <see cref="DeviceBase"/> class.
/// </summary>
/// <param name="poller">the <see cref="INetMQPoller"/> to use for detecting when messages are available</param>
/// <param name="frontendSocket">
/// A <see cref="NetMQSocket"/> that will pass incoming messages to <paramref name="backendSocket"/>.
/// </param>
/// <param name="backendSocket">
/// A <see cref="NetMQSocket"/> that will receive messages from (and optionally send replies to) <paramref name="frontendSocket"/>.
/// </param>
/// <param name="mode">the <see cref="DeviceMode"/> (either Blocking or Threaded) for this device</param>
/// <exception cref="ArgumentNullException">frontendSocket must not be null.</exception>
/// <exception cref="ArgumentNullException">backendSocket must not be null.</exception>
protected DeviceBase(INetMQPoller poller, NetMQSocket frontendSocket, NetMQSocket backendSocket, DeviceMode mode)
{
m_isInitialized = false;
if (frontendSocket == null)
throw new ArgumentNullException("frontendSocket");
if (backendSocket == null)
throw new ArgumentNullException("backendSocket");
FrontendSocket = frontendSocket;
BackendSocket = backendSocket;
FrontendSetup = new DeviceSocketSetup(FrontendSocket);
BackendSetup = new DeviceSocketSetup(BackendSocket);
m_poller = poller;
FrontendSocket.ReceiveReady += FrontendHandler;
BackendSocket.ReceiveReady += BackendHandler;
m_poller.Add(FrontendSocket);
m_poller.Add(BackendSocket);
m_runner = mode == DeviceMode.Blocking
? new DeviceRunner(this)
: new ThreadedDeviceRunner(this);
}
开发者ID:awb99,项目名称:netmq,代码行数:41,代码来源:DeviceBase.cs
示例3: ForwarderDevice
/// <summary>
/// Initializes a new instance of the <see cref="ForwarderDevice"/> class.
/// </summary>
/// <param name="poller">The <see cref="INetMQPoller"/> to use.</param>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public ForwarderDevice(INetMQPoller poller, string frontendBindAddress, string backendBindAddress,
DeviceMode mode = DeviceMode.Threaded)
: base(poller, new SubscriberSocket(), new PublisherSocket(), mode)
{
FrontendSetup.Bind(frontendBindAddress);
BackendSetup.Bind(backendBindAddress);
}
开发者ID:NetMQ,项目名称:NetMQ3-x,代码行数:14,代码来源:ForwarderDevice.cs
示例4: ForwarderDevice
/// <summary>
/// Initializes a new instance of the <see cref="ForwarderDevice"/> class.
/// </summary>
/// <param name="context">The <see cref="NetMQContext"/> to use when creating the sockets.</param>
/// <param name="poller">The <see cref="Poller"/> to use.</param>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public ForwarderDevice(NetMQContext context, Poller poller, string frontendBindAddress, string backendBindAddress,
DeviceMode mode = DeviceMode.Threaded)
: base(poller, context.CreateSubscriberSocket(), context.CreatePublisherSocket(), mode)
{
FrontendSetup.Bind(frontendBindAddress);
BackendSetup.Bind(backendBindAddress);
}
开发者ID:EugenDueck,项目名称:netmq,代码行数:15,代码来源:ForwarderDevice.cs
示例5: XForwarderDevice
/// <summary>
/// Initializes a new instance of the <see cref="ForwarderDevice"/> class.
/// </summary>
/// <param name="context">The <see cref="ZmqContext"/> to use when creating the sockets.</param>
/// <param name="frontendBindAddr">The address used to bind the frontend socket.</param>
/// <param name="backendBindAddr">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the current device.</param>
public XForwarderDevice(ZmqContext context, string frontendBindAddr, string backendBindAddr, DeviceMode mode)
: this(context, mode)
{
FrontendSetup.Bind(frontendBindAddr);
FrontendSetup.SubscribeAll();
BackendSetup.Bind(backendBindAddr);
}
开发者ID:eudaimos,项目名称:WaterBucket,代码行数:14,代码来源:XForwarderDevice.cs
示例6: QueueDevice
/// <summary>
/// Initializes a new instance of the <see cref="QueueDevice"/> class.
/// </summary>
/// <param name="context">The <see cref="NetMQContext"/> to use when creating the sockets.</param>
/// <param name="poller">The <see cref="Poller"/> to use.</param>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public QueueDevice(NetMQContext context, Poller poller, string frontendBindAddress, string backendBindAddress,
DeviceMode mode = DeviceMode.Threaded)
: base(poller, context.CreateRouterSocket(), context.CreateDealerSocket(), mode)
{
FrontendSetup.Bind(frontendBindAddress);
BackendSetup.Bind(backendBindAddress);
}
开发者ID:bubbafat,项目名称:netmq,代码行数:15,代码来源:QueueDevice.cs
示例7: StreamerDevice
/// <summary>
/// Initializes a new instance of the <see cref="StreamerDevice"/> class.
/// </summary>
/// <param name="poller">The <see cref="INetMQPoller"/> to use.</param>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public StreamerDevice(INetMQPoller poller, string frontendBindAddress, string backendBindAddress,
DeviceMode mode = DeviceMode.Threaded)
: base(poller, new PullSocket(), new PushSocket(), mode)
{
FrontendSetup.Bind(frontendBindAddress);
BackendSetup.Bind(backendBindAddress);
}
开发者ID:NetMQ,项目名称:NetMQ3-x,代码行数:14,代码来源:StreamerDevice.cs
示例8: StreamerDevice
/// <summary>
/// Initializes a new instance of the <see cref="StreamerDevice"/> class.
/// </summary>
/// <param name="context">The <see cref="NetMQContext"/> to use when creating the sockets.</param>
/// <param name="poller">The <see cref="Poller"/> to use.</param>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public StreamerDevice(NetMQContext context, Poller poller, string frontendBindAddress, string backendBindAddress,
DeviceMode mode = DeviceMode.Threaded)
: base(poller, context.CreatePullSocket(), context.CreatePushSocket(), mode)
{
FrontendSetup.Bind(frontendBindAddress);
BackendSetup.Bind(backendBindAddress);
}
开发者ID:wangkai2014,项目名称:netmq,代码行数:15,代码来源:StreamerDevice.cs
示例9: Generate
/// <summary>
/// 画面を指定量回転させるためのオブジェクトを生成
/// </summary>
/// <param name="monitorID">ディスプレイのデバイス番号</param>
/// <returns>生成に失敗した場合はnull</returns>
public static DisplayRotate Generate(int monitorID)
{
var mode = new DeviceMode(monitorID);
return mode.IsSucceeded
? new DisplayRotate(mode)
: null;
}
开发者ID:Boredbone,项目名称:MultiMonitorTools,代码行数:13,代码来源:DisplayRotate.cs
示例10: HidDeviceMode
public HidDeviceMode(DeviceMode readMode, DeviceMode writeMode, ShareMode shareMode)
{
if (!_needChangeStatus) return;
/*
If the flag is "false", then we have the previous values of the attributes.
Update the values is not required.
*/
ReadMode = readMode;
WriteMode = writeMode;
ShareMode = shareMode;
_needChangeStatus = false;
}
开发者ID:winstondiz,项目名称:HidLibrary,代码行数:12,代码来源:HidDeviceMode.cs
示例11: BMP085
public BMP085(byte address, DeviceMode deviceMode)
{
Address = address;
_slaveConfig = new I2CDevice.Configuration(address, ClockRateKHz);
_oversamplingSetting = (byte)deviceMode;
// Get calibration data that will be used for future measurement taking.
GetCalibrationData();
// Take initial measurements.
TakeMeasurements();
}
开发者ID:NicolasFatoux,项目名称:NfxLab.MicroFramework,代码行数:13,代码来源:BMP085.cs
示例12: OpenDeviceIO
internal static IntPtr OpenDeviceIO(string devicePath, DeviceMode deviceMode, uint deviceAccess)
{
var security = new NativeMethods.SECURITY_ATTRIBUTES();
var flags = 0;
if (deviceMode == DeviceMode.Overlapped) flags = NativeMethods.FILE_FLAG_OVERLAPPED;
security.lpSecurityDescriptor = IntPtr.Zero;
security.bInheritHandle = true;
security.nLength = Marshal.SizeOf(security);
return NativeMethods.CreateFile(devicePath, deviceAccess, NativeMethods.FILE_SHARE_READ | NativeMethods.FILE_SHARE_WRITE, ref security, NativeMethods.OPEN_EXISTING, flags, 0);
}
开发者ID:HaKDMoDz,项目名称:GNet,代码行数:13,代码来源:Device.Static.cs
示例13: OpenDevice
public void OpenDevice(DeviceMode readMode, DeviceMode writeMode, ShareMode shareMode)
{
if (IsOpen) return;
_deviceReadMode = readMode;
_deviceWriteMode = writeMode;
try
{
Handle = OpenDeviceIO(_devicePath, readMode, NativeMethods.GENERIC_READ | NativeMethods.GENERIC_WRITE, shareMode);
}
catch (Exception exception)
{
IsOpen = false;
throw new Exception("Error opening HID device.", exception);
}
IsOpen = Handle.ToInt32() != NativeMethods.INVALID_HANDLE_VALUE;
}
开发者ID:macaba,项目名称:HidLibrary,代码行数:19,代码来源:HidDevice.cs
示例14: HidDevice
public HidDevice(HidDeviceInfo info, DeviceMode devideReadMode, DeviceMode deviceWriteMode)
{
Path = info.Path;
Description = info.Description;
ReportID = 0x0;
DeviceReadMode = devideReadMode;
DeviceWriteMode = deviceWriteMode;
Timeout = 30;
try
{
Handle = OpenDeviceIO();
GetDeviceAttributes();
GetDeviceCapabilities();
}
catch
{
Dispose();
throw;
}
}
开发者ID:Cliveburr,项目名称:AutoHome,代码行数:21,代码来源:HidDevice.cs
示例15: Device
/// <summary>
/// Initializes a new instance of the <see cref="Device"/> class.
/// </summary>
/// <param name="frontendSocket">
/// A <see cref="ZmqSocket"/> that will pass incoming messages to <paramref name="backendSocket"/>.
/// </param>
/// <param name="backendSocket">
/// A <see cref="ZmqSocket"/> that will receive messages from (and optionally send replies to) <paramref name="frontendSocket"/>.
/// </param>
/// <param name="mode">The <see cref="DeviceMode"/> for the current device.</param>
protected Device(ZmqSocket frontendSocket, ZmqSocket backendSocket, DeviceMode mode)
{
if (frontendSocket == null)
{
throw new ArgumentNullException("frontendSocket");
}
if (backendSocket == null)
{
throw new ArgumentNullException("backendSocket");
}
FrontendSocket = frontendSocket;
BackendSocket = backendSocket;
FrontendSetup = new DeviceSocketSetup(FrontendSocket);
BackendSetup = new DeviceSocketSetup(BackendSocket);
DoneEvent = new ManualResetEvent(false);
_poller = new Poller();
_runner = mode == DeviceMode.Blocking ? new DeviceRunner(this) : new ThreadedDeviceRunner(this);
}
开发者ID:krageon,项目名称:clrzmq,代码行数:31,代码来源:Device.cs
示例16: ForwarderDevice
/// <summary>
/// Initializes a new instance of the <see cref="ForwarderDevice"/> class.
/// </summary>
/// <param name="context">The <see cref="Context"/> to use when creating the sockets.</param>
/// <param name="frontendBindAddr">The address used to bind the frontend socket.</param>
/// <param name="backendBindAddr">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the current device.</param>
public ForwarderDevice(Context context, string frontendBindAddr, string backendBindAddr, DeviceMode mode)
: this(context, mode)
{
FrontendSetup.Bind(frontendBindAddr);
BackendSetup.Bind(backendBindAddr);
}
开发者ID:jgoz,项目名称:crossroads-net,代码行数:13,代码来源:ForwarderDevice.cs
示例17: QueueDevice
/// <summary>
/// Initializes a new instance of the <see cref="QueueDevice"/> class.
/// </summary>
/// <param name="frontendBindAddress">The endpoint used to bind the frontend socket.</param>
/// <param name="backendBindAddress">The endpoint used to bind the backend socket.</param>
/// <param name="mode">The <see cref="DeviceMode"/> for the device.</param>
public QueueDevice(string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded)
: base(new RouterSocket(), new DealerSocket(), mode)
{
FrontendSetup.Bind(frontendBindAddress);
BackendSetup.Bind(backendBindAddress);
}
开发者ID:NetMQ,项目名称:NetMQ3-x,代码行数:12,代码来源:QueueDevice.cs
示例18: Open
/// <summary>
/// Open the device. To start capturing call the 'StartCapture' function
/// </summary>
/// <param name="mode">
/// A <see cref="DeviceMode"/>
/// </param>
public override void Open(DeviceMode mode) {
const int readTimeoutMilliseconds = 1000;
this.Open(mode, readTimeoutMilliseconds);
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:10,代码来源:LibPcapLiveDevice.cs
示例19: Initialize
public static Graphics.Renderer.Results Initialize(DeviceMode deviceMode)
{
if (!Directory.Exists(Graphics.Application.ApplicationDataFolder + "Logs"))
Directory.CreateDirectory(Graphics.Application.ApplicationDataFolder + "Logs");
SlimDX.Direct3D9.Direct3D d3d = new SlimDX.Direct3D9.Direct3D();
#if LOG_DEVICE_SETTINGS
System.IO.StreamWriter deviceSettingsLogFile = new System.IO.StreamWriter(Graphics.Application.ApplicationDataFolder + "Logs/DeviceSettingsLog.txt");
deviceSettingsLogFile.WriteLine("======== Graphics Device Capabilities ========");
#endif
int maxWidth = 700;
int maxHeight = 500;
foreach (SlimDX.Direct3D9.DisplayMode dm in d3d.Adapters[0].GetDisplayModes(SlimDX.Direct3D9.Format.X8R8G8B8))
{
if(!SettingConverters.ResolutionListConverter.Resolutions.Contains(new Resolution() { Width = dm.Width, Height = dm.Height }))
{
if (dm.Width > maxWidth || dm.Height > maxHeight)
{
SettingConverters.ResolutionListConverter.Resolutions.Add(new Resolution() { Width = dm.Width, Height = dm.Height });
if(dm.Width > maxWidth)
maxWidth = dm.Width;
if (dm.Height > maxHeight)
maxHeight = dm.Height;
}
}
}
if (d3d.CheckDeviceMultisampleType(0, SlimDX.Direct3D9.DeviceType.Hardware, SlimDX.Direct3D9.Format.X8R8G8B8,
deviceMode == DeviceMode.Fullscreen ? false : true, SlimDX.Direct3D9.MultisampleType.None))
{
SettingConverters.AntiAliasingConverter.MultiSampleTypes.Add(SlimDX.Direct3D9.MultisampleType.None);
}
if (d3d.CheckDeviceMultisampleType(0, SlimDX.Direct3D9.DeviceType.Hardware, SlimDX.Direct3D9.Format.X8R8G8B8,
deviceMode == DeviceMode.Fullscreen ? false : true, SlimDX.Direct3D9.MultisampleType.TwoSamples))
{
SettingConverters.AntiAliasingConverter.MultiSampleTypes.Add(SlimDX.Direct3D9.MultisampleType.TwoSamples);
}
if (d3d.CheckDeviceMultisampleType(0, SlimDX.Direct3D9.DeviceType.Hardware, SlimDX.Direct3D9.Format.X8R8G8B8,
deviceMode == DeviceMode.Fullscreen ? false : true, SlimDX.Direct3D9.MultisampleType.FourSamples))
{
SettingConverters.AntiAliasingConverter.MultiSampleTypes.Add(SlimDX.Direct3D9.MultisampleType.FourSamples);
}
if (d3d.CheckDeviceMultisampleType(0, SlimDX.Direct3D9.DeviceType.Hardware, SlimDX.Direct3D9.Format.X8R8G8B8,
deviceMode == DeviceMode.Fullscreen ? false : true, SlimDX.Direct3D9.MultisampleType.EightSamples))
{
SettingConverters.AntiAliasingConverter.MultiSampleTypes.Add(SlimDX.Direct3D9.MultisampleType.EightSamples);
}
if (d3d.CheckDeviceMultisampleType(0, SlimDX.Direct3D9.DeviceType.Hardware, SlimDX.Direct3D9.Format.X8R8G8B8,
deviceMode == DeviceMode.Fullscreen ? false : true, SlimDX.Direct3D9.MultisampleType.SixteenSamples))
{
SettingConverters.AntiAliasingConverter.MultiSampleTypes.Add(SlimDX.Direct3D9.MultisampleType.SixteenSamples);
}
SlimDX.Direct3D9.Capabilities caps = d3d.GetDeviceCaps(0, SlimDX.Direct3D9.DeviceType.Hardware);
SlimDX.Direct3D9.FilterCaps c = caps.TextureFilterCaps;
if((c & SlimDX.Direct3D9.FilterCaps.MinLinear) != 0 && (c & SlimDX.Direct3D9.FilterCaps.MagLinear) != 0)
{
SettingConverters.TextureFilteringConverter.TextureFilteringTypesDict.Add(TextureFilterEnum.Bilinear, new TextureFilters()
{
TextureFilter = TextureFilterEnum.Bilinear,
AnisotropicLevel = 1,
TextureFilterMin = SlimDX.Direct3D9.TextureFilter.Linear,
TextureFilterMag = SlimDX.Direct3D9.TextureFilter.Linear,
TextureFilterMip = SlimDX.Direct3D9.TextureFilter.Point
});
if ((c & SlimDX.Direct3D9.FilterCaps.MipLinear) != 0)
SettingConverters.TextureFilteringConverter.TextureFilteringTypesDict.Add(TextureFilterEnum.Trilinear, new TextureFilters()
{
TextureFilter = TextureFilterEnum.Trilinear,
AnisotropicLevel = 1,
TextureFilterMin = SlimDX.Direct3D9.TextureFilter.Linear,
TextureFilterMag = SlimDX.Direct3D9.TextureFilter.Linear,
TextureFilterMip = SlimDX.Direct3D9.TextureFilter.Linear
});
}
if((c & SlimDX.Direct3D9.FilterCaps.MinAnisotropic) != 0 && (c & SlimDX.Direct3D9.FilterCaps.MagAnisotropic) != 0)
{
if ((c & SlimDX.Direct3D9.FilterCaps.MipLinear) != 0)
{
if (caps.MaxAnisotropy >= 2)
SettingConverters.TextureFilteringConverter.TextureFilteringTypesDict.Add(TextureFilterEnum.Anisotropic2x, new TextureFilters()
{
TextureFilter = TextureFilterEnum.Anisotropic2x,
AnisotropicLevel = 2,
TextureFilterMin = SlimDX.Direct3D9.TextureFilter.Anisotropic,
TextureFilterMag = SlimDX.Direct3D9.TextureFilter.Anisotropic,
TextureFilterMip = SlimDX.Direct3D9.TextureFilter.Linear
});
if (caps.MaxAnisotropy >= 4)
SettingConverters.TextureFilteringConverter.TextureFilteringTypesDict.Add(TextureFilterEnum.Anisotropic4x, new TextureFilters()
{
TextureFilter = TextureFilterEnum.Anisotropic4x,
//.........这里部分代码省略.........
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:101,代码来源:Settings.cs
示例20: ChangeDisplaySettingsEx
public static extern int ChangeDisplaySettingsEx([MarshalAs(UnmanagedType.LPTStr)] string lpszDeviceName, DeviceMode lpDevMode, IntPtr hwnd, ChangeDisplaySettingsEnum dwflags, IntPtr lParam);
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:1,代码来源:WglGraphicsContext.cs
注:本文中的DeviceMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论