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


C# DeviceInfo类代码示例

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


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

示例1: Scan

        public Image Scan(DeviceInfo device)
        {
            if (device == null)
                throw new ArgumentException("Device must be specified");

            var scanner = device.Connect();

            var wiaCommonDialog = new WPFCommonDialog();
            var item = scanner.Items[1];
            var image = (ImageFile)wiaCommonDialog.ShowTransfer(item, wiaFormatBMP, false);

            string fileName = Path.GetTempFileName();
            File.Delete(fileName);
            image.SaveFile(fileName);
            image = null;

            // add file to output list
            return Image.FromFile(fileName);
        }
开发者ID:JakeGinnivan,项目名称:Enhance,代码行数:19,代码来源:ScannerService.cs

示例2: From

 public static DeviceInfo From(DeviceInfo di)
 {
     DeviceInfo result = new DeviceInfo(di.DriveName);
     result.DeviceXml = di.DeviceXml;
     result.DeviceName = di.DeviceName;
     return result;
 }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:7,代码来源:GarminMassStorage.cs

示例3: ActiveScanner

        private void ActiveScanner(DeviceInfo selectedScanner)
        {
            if (selectedScanner != null && !selectedScanner.IsDeviceInfoOf(activeScanner))
            {
                DeactivateScanner();

                UpdateEventHistory(string.Format("Activate Scanner:{0}", selectedScanner.ServiceObjectName));
                try
                {
                    activeScanner = (Scanner)explorer.CreateInstance(selectedScanner);
                    activeScanner.Open();
                    activeScanner.Claim(1000);
                    activeScanner.DeviceEnabled = true;
                    activeScanner.DataEvent += new DataEventHandler(activeScanner_DataEvent);
                    activeScanner.ErrorEvent += new DeviceErrorEventHandler(activeScanner_ErrorEvent);
                    activeScanner.DecodeData = true;
                    activeScanner.DataEventEnabled = true;
                }
                catch (PosControlException)
                {
                    UpdateEventHistory(string.Format("Activation Failed:{0}", selectedScanner.ServiceObjectName));
                    activeScanner = null;
                }
            }
        }
开发者ID:RiazMahmud,项目名称:ATK-Computer-LTD,代码行数:25,代码来源:Home_Admin_EntryNewProduct.cs

示例4: 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

示例5: Update

        public static bool Update(UserConfiguration userConfig, DeviceInfo deviceInfo)
        {
            var deviceInfos = new List<DeviceInfo>();
            deviceInfos.Add(deviceInfo);

            return Update(userConfig, deviceInfos);
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:7,代码来源:Update.cs

示例6: InstallApplication

 public static void InstallApplication(
     DeviceInfo deviceInfo, 
     IAppManifestInfo manifestInfo, 
     DeploymentOptions deploymentOptions, 
     string packageFile)
 {
     DeployApplication(DeployAppMode.Install, deviceInfo, manifestInfo, deploymentOptions, packageFile);
 }
开发者ID:shasanraj,项目名称:Winium.StoreApps.CodedUi,代码行数:8,代码来源:Utils.cs

示例7: GetDeviceInfo

 /// <summary>
 /// Get Information for a Device (CPU/GPU/...)
 /// </summary>
 /// <returns></returns>
 public static OpenCLErrorCode GetDeviceInfo(DeviceHandle device,
                                       DeviceInfo paramName,
                                       IntPtr paramValueSize,
                                       InfoBuffer paramValue,
                                       out IntPtr paramValueSizeRet)
 {
     return clGetDeviceInfo((device as IHandleData).Handle, paramName, paramValueSize, paramValue.Address, out paramValueSizeRet);
 }
开发者ID:Multithread,项目名称:OpenOCL_NET,代码行数:12,代码来源:OpenCL_DeviceInformation.cs

示例8: ArcazeDevice

        public ArcazeDevice(DeviceInfo info)
        {
            this.arcazeDevice = new ArcazeHid();
            Connect(ref info);

            this.arcazeDevice.DeviceRemoved += new EventHandler<HidEventArgs>(this.DeviceRemoved);
            this.arcazeDevice.OurDeviceRemoved += new EventHandler<HidEventArgs>(this.OurDeviceRemoved);
        }
开发者ID:H-J-P,项目名称:DAC-Source,代码行数:8,代码来源:ArcaseDevice.cs

示例9: Load

        public void Load()
        {
            var device = new DeviceInfo();
            device.Load();

            ScreenResolution = string.Format(CultureInfo.InvariantCulture, "{0}x{1}", device.ScreenResolution.Width, device.ScreenResolution.Height);

            RaisePropertyChanged("ScreenResolution");
        }
开发者ID:seriema,项目名称:WP7Caps,代码行数:9,代码来源:DeviceInfoViewModel.cs

示例10: Check

 /// <summary>
 /// Checks to see if the current device or the useragent string contain each
 /// other at the start.
 /// </summary>
 /// <param name="userAgent">The useragent being searched for.</param>
 /// <param name="bestMatch">Reference to the best matching device so far.</param>
 /// <param name="maxInitialString">The maximum number of characters that have matched in the search so far.</param>
 /// <param name="current">The current device being checked for a match.</param>
 private static void Check(string userAgent, ref DeviceInfo bestMatch, ref int maxInitialString,
     DeviceInfo current)
 {
     if ((userAgent.StartsWith(current.UserAgent) ||
          current.UserAgent.StartsWith(userAgent)) &&
         maxInitialString < current.UserAgent.Length)
     {
         maxInitialString = current.UserAgent.Length;
         bestMatch = current;
     }
 }
开发者ID:irobinson,项目名称:51DegreesDNN,代码行数:19,代码来源:Matcher.cs

示例11: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var ignored = base.OnCreateView(inflater, container, savedInstanceState);
			this.EnsureBindingContextIsSet(savedInstanceState);
			View _view = this.BindingInflate(Resource.Layout.MenuView, null);

			_deviceInfoPlugin = Mvx.Resolve<IMvxDeviceInfo>();
			_deviceInfo = _deviceInfoPlugin.GetDeviceInfo ();

			View mv = _view.FindViewById (Resource.Id.menu_view_layout_main);
			TreeListView treeView = (TreeListView)_view.FindViewById (Resource.Id.menu_categories_listview);
			return _view;
		}
开发者ID:fpt-software,项目名称:Wordpress-Client,代码行数:13,代码来源:MenuView.cs

示例12: LoginDevice

        /// <summary>
        /// 尝试登陆某一个设备
        /// </summary>
        /// <returns>是否登陆成功</returns>
        private bool LoginDevice(DeviceInfo loginInfo)
        {
            //某个设备可能回登陆失败所以要try。
            //todo
            try
            {
            }
            catch (Exception)
            {

                throw;
            }
            return true;
        }
开发者ID:litao008,项目名称:LitaoWorld,代码行数:18,代码来源:DeviceLogIn.cs

示例13: StringToObject

        /// <summary>
        /// 把String转换成Object
        /// </summary>
        /// <param name="deviceConfig">按一定格式排列的设备信息字符串</param>
        private DeviceInfo StringToObject(string deviceConfig)
        {
            string[] configs = deviceConfig.Split(',');
            if (configs.Length == 7)
            {
                try
                {
                    DeviceInfo deviceLoginInfo = new DeviceInfo();

                    if (ParameterCheck.IsIpAddress(configs[0]))
                    {
                        deviceLoginInfo.Ip = configs[0];
                    }

                    LogInType type;
                    if (Enum.TryParse(configs[1],true,out type))
                    {
                        deviceLoginInfo.Type = type;
                    }

                    int port;
                    if (int.TryParse(configs[2], out port))
                    {
                        deviceLoginInfo.Port = port;
                    }

                    deviceLoginInfo.LoginReq = configs[3].Equals("true",StringComparison.CurrentCultureIgnoreCase);
                    LogInStatus status;
                    if (Enum.TryParse(configs[4], true, out status))
                    {
                        deviceLoginInfo.Status = status;
                    }

                    deviceLoginInfo.BelongTo = configs[5];

                    if (ParameterCheck.IsIpAddress(configs[6]))
                    {
                        deviceLoginInfo.LocalIp = configs[6];
                    }
                    return deviceLoginInfo;
                }
                catch (Exception)
                {
                    //todo log
                    return null;
                }
            }
            return null;
        }
开发者ID:litao008,项目名称:LitaoWorld,代码行数:53,代码来源:DeviceConfigManager.cs

示例14: MerchantInfo

        /// <summary>
        /// 
        /// </summary>
        public MerchantInfo()
        {
            supportsManualRefunds = true;
            supportsTipAdjust = true;
            supportsVaultCards = true;
            supportsPreAuths = true;
            merchantID = "";
            merchantMId = "";
            merchantName = "";

            Device = new DeviceInfo();
            Device.Name = "";
            Device.Serial = "";
            Device.Model = "";
        }
开发者ID:clover,项目名称:remote-pay-windows,代码行数:18,代码来源:MerchantInfo.cs

示例15: BuildEntity

 private DeviceInfo BuildEntity()
 {
     DeviceInfo user = new DeviceInfo();
     user.ID = GetFormInteger("id");
     user.IP = Request.Form["ip"];
     user.Port = Request.Form["port"];
     user.DeviceType = Request.Form["deviceType"];
     user.UserName = Request.Form["userName"];
     user.Password = Request.Form["password"];
     user.AntNo = GetFormInteger("antNo");
     user.AccessFlag = GetFormInteger("accessFlag");
     user.Location = Request.Form["location"];
     user.Active = Request.Form["active"] == "true";
     return user;
 }
开发者ID:weihongji,项目名称:FRAS,代码行数:15,代码来源:DeviceAjax.aspx.cs


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