• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DeviceType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DeviceType的典型用法代码示例。如果您正苦于以下问题:C# DeviceType类的具体用法?C# DeviceType怎么用?C# DeviceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DeviceType类属于命名空间,在下文中一共展示了DeviceType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RegisterDevice

        public string RegisterDevice(int tenantID, string userID, string token, DeviceType type)
        {
            if (string.IsNullOrEmpty(token))
                throw new FaultException("empty device token");

            if (string.IsNullOrEmpty(userID))
                throw new FaultException("empty user id");

            var device = GetDeviceDao().GetAll(tenantID, userID).FirstOrDefault(x => x.Token == token);

            if (device == null)
            {
                _log.DebugFormat("register device ({0}, {1}, {2}, {3})", tenantID, userID, token, type);
                device = new Device
                    {
                        TenantID = tenantID,
                        UserID = userID,
                        Token = token,
                        Type = type
                    };

                GetDeviceDao().Save(device);
            }

            return device.RegistrationID;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:26,代码来源:PushService.cs


示例2: addDevice

 public void addDevice(int deviceID, DeviceInfo deviceInfo, DeviceType deviceType)
 {
     Debug.Log("addDevice("+deviceID+", "+deviceInfo+", "+deviceType+")");
     bool alreadyEquiped = (!_equipedDevices.Exists(device => device.getID() == deviceID));
     bool alreadyInventory = (!_inventoryDevices.Exists(device => device.getID() == deviceID));
     if(alreadyEquiped || alreadyInventory) {
         Vector3 localPosition;
         UnityEngine.Transform parent;
         List<DisplayedDevice> devices;
         int newDeviceId = deviceID;
         if(deviceType == DeviceType.Equiped) {
             parent = equipPanel.transform;
             devices = _equipedDevices;
             if(deviceID == 0) {
                 newDeviceId = devices.Count;
             }
             Debug.Log("addDevice("+newDeviceId+") in equipment");
         } else {
             parent = inventoryPanel.transform;
             devices = _inventoryDevices;
             Debug.Log("addDevice("+newDeviceId+") in inventory");
         }
         localPosition = getNewPosition(deviceType);
         DisplayedDevice newDevice = DisplayedDevice.Create (parent, localPosition, newDeviceId, deviceType, deviceInfo, this);
         devices.Add(newDevice);
         //let's add reaction to reaction engine
         //for each module of deviceInfo, add to reaction engine
         //deviceInfo._modules.ForEach( module => module.addToReactionEngine(celliaMediumID, reactionEngine));
     } else {
         Debug.Log("addDevice failed: alreadyEquiped="+alreadyEquiped+", alreadyInventory="+alreadyInventory);
     }
 }
开发者ID:quito,项目名称:DSynBio_reloaded,代码行数:32,代码来源:DevicesDisplayer.cs


示例3: GetDeviceObject

        // Using device type decideds which device object to initilise, this allows for dynamic object creation.
        public static DeviceBase GetDeviceObject(DeviceInformation deviceInfo, DeviceType type)
        {
            DeviceBase device = null;
            // Main switch statement to handle the creation of the device objects.
            switch (type)
            {
                case DeviceType.GenericAccess:
                    device = new GenericAccessDevice();
                    break;
                case DeviceType.HeartRate:
                    device = new HeartRateMonitorDevice();
                    break;
            }

            if (device == null)
            {
                // Display error if device does not have a value and return null.
                MessageHelper.DisplayBasicMessage(StringResources.InitialisationError);
                return device;
            }

            device.Initialise(deviceInfo.Id);

            return device;
        }
开发者ID:EarnieGC,项目名称:AppAcceleratorKit,代码行数:26,代码来源:DeviceHelper.cs


示例4: ControlModuleOrChannelLocateCommand

 /// <summary>
 /// 定位模块或通道的命令
 /// </summary>
 /// <param name="deviceType">设备类型</param>
 /// <returns></returns>
 public Byte[] ControlModuleOrChannelLocateCommand(DeviceType deviceType = DeviceType.Module)
 {
     return GetDatagram(MessageId.ControlModuleOrChannelLocate,
         deviceType == DeviceType.Channel ?
         new Parameter(ParameterType.ChannelNo, ChannelNo) :
         new Parameter(ParameterType.None, 0X00));
 }
开发者ID:lyming531,项目名称:AirHome,代码行数:12,代码来源:ControlAction.cs


示例5: CtlCode

 public static int CtlCode(DeviceType type, int function, DeviceControlMethod method, DeviceControlAccess access)
 {
     return ((int)type << 16) |
         ((int)access << 14) |
         (function << 2) |
         (int)method;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:7,代码来源:NativeDefinitions.cs


示例6: clGetDeviceIDs

		public extern static int clGetDeviceIDs (
			IntPtr platform,
			DeviceType device_type,
			uint num_entries,
			IntPtr[] devices,
			out uint num_devices
		);
开发者ID:kazuki,项目名称:opencl.net,代码行数:7,代码来源:Native.cs


示例7: Trame

        /// <summary>
        /// Initializes a new instance of the <see cref="Trame"/> class.
        /// </summary>
        /// <param name="dt">Dt.</param>
        public Trame(DeviceType dt)
        {
            last = Creator.GetNewInvalidSkeleton();
            currentType = dt;

            resetTimer = new Timer(1000);
            resetTimer.AutoReset = true;
            lastUpdate = DateTime.Now;

            resetTimer.Elapsed += (sender, args) =>
            {
                if ((dt == DeviceType.KINECT || dt == DeviceType.LEAP_MOTION_AND_KINECT) && !resetInProgress && (DateTime.Now - lastUpdate).TotalMilliseconds > 2000)
                {
                    resetInProgress = true;
                    // reset trame
                    UpdatedType();
                    currentDevice.Start();

                    resetInProgress = false;
                    lastUpdate = DateTime.Now;
                }
            };

            UpdatedType();
        }
开发者ID:i2e-haw-hamburg,项目名称:trame,代码行数:29,代码来源:Trame.cs


示例8: HDPApp

        public HDPApp(DeviceType deviceType, IBlobCache cache)
        {
            RxApp.DefaultExceptionHandler = Observer.Create ((Exception e) => {
                System.Diagnostics.Debug.WriteLine(e.Message); 
                System.Diagnostics.Debug.WriteLine(e.StackTrace);
            });

            BlobCache.ApplicationName = "HDP";
            _cache = BlobCache.LocalMachine;

            JsonConvert.DefaultSettings = 
                () => new JsonSerializerSettings() { 
                ContractResolver = new CamelCasePropertyNamesContractResolver(),
                Converters = {new MediaTypeConverter(), new StringEnumConverter()}
            };

            _apiService = new ApiService (deviceType: deviceType);
            _newsService = new NewsService (_apiService);
            _eventsService = new EventsService (_apiService);
            _electionArticlesService = new ElectionArticlesService (_apiService);

            Locator.CurrentMutable.RegisterConstant (this, typeof(HDPApp));

            State = new AppState ();

            UserCity.Subscribe (city => {
                System.Diagnostics.Debug.WriteLine("Current city is: {0}", city); 
            });

            _repository = new ContentRepository (_newsService, _electionArticlesService, _eventsService, cache);

            ImplementCommands ();
        }
开发者ID:dbeattie71,项目名称:HDP-Mobil,代码行数:33,代码来源:HDPApp.cs


示例9: WriteChassisFru

        /// <summary>
        /// Write to Chassis Fru - (Important) note that this function enables write to any offset 
        /// Offset checks ensures that we are within permissible limits, but cannot enforce semantics within those limits
        /// Length checks validity of packet, however empty fields in packet are responsibility of writing function
        /// User level priority since this is not an internal call
        /// </summary>
        /// <param name="offset"></param>
        /// <param name="length"></param>
        /// <param name="packet"></param>
        /// <returns></returns>
        public CompletionCode WriteChassisFru(ushort offset, ushort length, 
            byte[] packet, DeviceType deviceType)
        {
            ChassisFruWriteResponse response = new ChassisFruWriteResponse();
            response.CompletionCode = (byte)CompletionCode.UnspecifiedError;

            try
            {
                response = (ChassisFruWriteResponse)this.SendReceive(deviceType,
                    this.DeviceId, new ChassisFruWriteRequest(offset, length, packet),
                 typeof(ChassisFruWriteResponse), (byte)PriorityLevel.User);
            }
            catch (Exception ex)
            {
                Tracer.WriteError(string.Format("ChassisFru.WriteChassisFru() Write had an exception with paramaters: Offset: {0} Length: {1} Packet: {2} DeviceType: {3} Exception: {4}",
                    offset, length, (packet == null ? "Null packet" : Ipmi.IpmiSharedFunc.ByteArrayToHexString(packet)), deviceType.ToString(), ex));
            }

            if (response.CompletionCode != (byte)CompletionCode.Success)
            {
                Tracer.WriteError("ChassisFru.WriteChassisFru() write failed with completion code {0:X}", response.CompletionCode);
            }

            return (CompletionCode)response.CompletionCode;
        }
开发者ID:silupher,项目名称:ChassisManager,代码行数:35,代码来源:ChassisFru.cs


示例10: OutputRequirements

 public OutputRequirements(DeviceType devType, bool hardwareTnL, Version ps, Version vs)
 {
     this.devType = devType;
     this.hardwareTnL = hardwareTnL;
     this.ps = ps;
     this.vs = vs;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:OutputRequirements.cs


示例11: HttpWiflyImpl

 public HttpWiflyImpl(HttpImplementationClient.RequestReceivedDelegate requestReceived, int localPort, DeviceType deviceType, SPI.SPI_module spiModule, Cpu.Pin chipSelect)
 {
     m_requestReceived = requestReceived;
     LocalPort = localPort;
     this.m_spiModule = spiModule;
     this.m_chipSelect = chipSelect;
 }
开发者ID:metroidprimedude,项目名称:ASEC-Robotics,代码行数:7,代码来源:WiFlyShield.cs


示例12: DeviceView

        //-------------------------------------------------------------------------------------
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="device">ref NodeController</param>
        /// <param name="deviceType">type of device</param>
        public DeviceView(DeviceController device, DeviceType deviceType)
        {
            InitializeComponent();
            this.deviceController = device;

            BitmapImage bi3 = new BitmapImage();

            if (deviceType == DeviceType.dPc)
            {
                bi3.BeginInit();
                bi3.UriSource = new Uri("/GEditor;component/Resources/screen_zoom_in_ch.png", UriKind.Relative);
                bi3.EndInit();
            }
            else
            {
                if (deviceType == DeviceType.dSwitch)
                {
                    bi3.BeginInit();
                    bi3.UriSource = new Uri("/GEditor;component/Resources/switch_ch.png", UriKind.Relative);
                    bi3.EndInit();
                }
                else
                {
                    bi3.BeginInit();
                    bi3.UriSource = new Uri("/GEditor;component/Resources/password_ch.png", UriKind.Relative);
                    bi3.EndInit();
                }
            }
            this.point.Source = bi3;
            Canvas.SetZIndex(this, 2);
            this.point.Width = this.point.Height = radiusView;
        }
开发者ID:boddichegTest,项目名称:testRepo,代码行数:38,代码来源:DeviceView.xaml.cs


示例13: GraphicsDeviceInformation

 public GraphicsDeviceInformation()
 {
     deviceType = DeviceType.Hardware;
     adapter = GraphicsAdapter.DefaultAdapter;
     presentationParameters = new PresentationParameters();
     presentationParameters.Clear();
 }
开发者ID:sergios1234,项目名称:monoxna,代码行数:7,代码来源:GraphicsDeviceInformation.cs


示例14: DeviceAnnouncement

 internal DeviceAnnouncement(UpnpClient client, DeviceType type, string udn, IEnumerable<string> locations)
 {
     this.client = client;
     this.type = type;
     this.udn = udn;
     this.locations = locations;
 }
开发者ID:MustafaUzumcuCom,项目名称:mono-upnp,代码行数:7,代码来源:DeviceAnnouncement.cs


示例15: DeviceBase

 public DeviceBase(AudioBase audio, VideoBase video)
 {
     _audio = audio;
     _video = video;
     _deviceType = DeviceType.NO_DEVICE;
     _name = "Plug in your Kinect";
 }
开发者ID:darekf77,项目名称:KinectWrapper,代码行数:7,代码来源:DeviceBase.cs


示例16: CreateMiner

        public static Miner CreateMiner(DeviceType deviceType, string minerPath)
        {
            if (minerPath == MinerPaths.eqm && DeviceType.AMD != deviceType) {
                return new eqm();
            } else if (minerPath == MinerPaths.nheqminer) {
                return new nheqminer();
            } else if (
                ConfigManager.GeneralConfig.Use3rdPartyMiners == Use3rdPartyMiners.YES
                && minerPath == MinerPaths.ClaymoreZcashMiner && DeviceType.AMD == deviceType) {
                return new ClaymoreZcashMiner();
            } else if (minerPath == MinerPaths.ethminer && DeviceType.CPU != deviceType) {
                if (DeviceType.AMD == deviceType) {
                    return new MinerEtherumOCL();
                } else {
                    return new MinerEtherumCUDA();
                }
            } else if (minerPath.Contains("cpuminer") && DeviceType.CPU == deviceType) {
                return new cpuminer();
            } else if (minerPath.Contains("sgminer") && DeviceType.AMD == deviceType) {
                return new sgminer();
            } else if(minerPath.Contains("ccminer") && DeviceType.NVIDIA == deviceType) {
                return new ccminer();
            }

            return null;
        }
开发者ID:nicehash,项目名称:NiceHashMiner,代码行数:26,代码来源:MinersManager.cs


示例17: Deploy

        internal void Deploy(DeviceType device)
        {
            if (m_xap == null)
            {
                throw new InvalidOperationException("Target application is not selected.");
            }

            var hookProvider = new HookProvider(
                m_view.GetLogMethodNames(),
                m_view.GetLogParameterValues(),
                m_view.GetLogReturnValues(),
                m_view.GetHooks()
                );

            PatchTask patchTask = new PatchTask(
                m_xap,
                hookProvider,
                device,
                AddOutputText,
                ResetButton
                );

            var context = TaskScheduler.FromCurrentSynchronizationContext();

            Task.Factory.StartNew(patchTask.Run)
                .ContinueWith(t =>
                {
                    if (t.IsFaulted)
                    {
                        HandleError(t.Exception.InnerException);
                    }
                },
                context
                );
        }
开发者ID:andreycha,项目名称:tangerine,代码行数:35,代码来源:MainPresenter.cs


示例18: CreateZonesFile

		public void CreateZonesFile(string inputFilename, string outputFilename, string guid, string userName, long userId, string completitionCode, DeviceType device, EngineVersion version)
		{
            FileStream inputStream = null;
            Cartridge cartridge;

            try
            {
                // Open Lua file
                inputStream = new FileStream(inputFilename, FileMode.Open);

                // Create input object for plain folders
                IInput input = new Folder(inputStream, inputFilename);

                // Check Lua file
                input.Check();

                // Load Lua code and extract all required data
                cartridge = input.Load();

                // Close input
                input = null;
            }
            finally
            {
                if (inputStream != null)
                {
                    inputStream.Close();
                    inputStream = null;
                }
            }

			// Create selected engine
			IEngine engine = Compiler.CreateEngine(device);

			// Convert Lua code and insert special code for this player
			cartridge = engine.ConvertCartridge(cartridge);
			userName = engine.ConvertString(userName);

			// ---------- Compile Lua code into binary chunk ----------

			// Compile Lua code
			cartridge.Chunk = LUA.Compile(cartridge.LuaCode, cartridge.LuaFileName);

			// ---------- Save cartridge as GWC file ----------

			// Create object for output format (could be also WFC or any other IOutput)
			var outputFormat = new GWC();

			// Write output file
			// Create output in correct format
			var ms = outputFormat.Create(cartridge, userName, userId, completitionCode);
			// Save output to file
			using(FileStream ofs = new FileStream(outputFilename, FileMode.Create)) {
				ms.CopyTo(ofs);
				// Close output
				ofs.Flush();
				ofs.Close();
			}
		}
开发者ID:WFoundation,项目名称:WF.Compiler,代码行数:59,代码来源:CompilerWherigoBuilder.cs


示例19: AntiAliasCaps

 public AntiAliasCaps(int adapter, DeviceType devType, Format format)
 {
     availableTypes = new List<MultiSampleType>();
     for (int i = 0; i <= 16; i++)
     {
         CheckMultiSampleType(adapter, (MultiSampleType)i, devType, format);
     }
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:AntiAliasCaps.cs


示例20: CreateContextFromType

 public static ContextHandle CreateContextFromType(ContextProperty[] properties,
                                             DeviceType deviceType,
                                             ContextNotify pfnNotify,
                                             IntPtr userData,
                                             out OpenCLErrorCode errcodeRet)
 {
     return new ContextHandle(clCreateContextFromType(properties, deviceType, pfnNotify, userData, out errcodeRet));
 }
开发者ID:Multithread,项目名称:OpenOCL_NET,代码行数:8,代码来源:OpenCL_ContextInformation.cs



注:本文中的DeviceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DexTargetPackage类代码示例发布时间:2022-05-24
下一篇:
C# DeviceState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap