コード例 #1
0
ファイル: Profiler.cs プロジェクト: liangminhua/wptools
        private void GetInternalDevice()
        {
            BindingFlags eFlags    = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
            var          fieldInfo = (typeof(Microsoft.SmartDevice.Connectivity.Wrapper.DeviceObject)).GetField("mDevice", eFlags);

            if (fieldInfo != null)
            {
                _internalDevice = fieldInfo.GetValue(_device.CurrentDevice) as Microsoft.SmartDevice.Connectivity.Device;
            }

            // TODO: throw exception if this fails?
        }
コード例 #2
0
ファイル: WP7Device.cs プロジェクト: whztt07/DeltaEngine
		internal WP7Device(MsDevice nativeDevice)
		{
			this.nativeDevice = nativeDevice;
			Name = nativeDevice.Name;
			IsEmulator = Name.Contains("Emulator");
		}
コード例 #3
0
 internal WP7Device(MsDevice nativeDevice)
 {
     this.nativeDevice = nativeDevice;
     Name       = nativeDevice.Name;
     IsEmulator = Name.Contains("Emulator");
 }
コード例 #4
0
        private void GetInternalDevice()
        {
            BindingFlags eFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
            var fieldInfo = (typeof(Microsoft.SmartDevice.Connectivity.Wrapper.DeviceObject)).GetField("mDevice", eFlags);

            if (fieldInfo != null)
            {
                _internalDevice = fieldInfo.GetValue(_device.CurrentDevice) as Microsoft.SmartDevice.Connectivity.Device;
            }

            // TODO: throw exception if this fails?
        }