当前位置: 首页>>代码示例>>C#>>正文


C# DeviceType类代码示例

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


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


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