本文整理汇总了C#中IDevice类的典型用法代码示例。如果您正苦于以下问题:C# IDevice类的具体用法?C# IDevice怎么用?C# IDevice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDevice类属于命名空间,在下文中一共展示了IDevice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoteAndroidTestRunner
/// <summary>
/// Creates a remote Android test runner.
/// </summary>
/// <param name="packageName"> the Android application package that contains the tests to run </param>
/// <param name="runnerName"> the instrumentation test runner to execute. If null, will use default
/// runner </param>
/// <param name="remoteDevice"> the Android device to execute tests on </param>
public RemoteAndroidTestRunner(string packageName, string runnerName, IDevice remoteDevice)
{
mPackageName = packageName;
mRunnerName = runnerName;
mRemoteDevice = remoteDevice;
mArgMap = new Dictionary<string, string>();
}
示例2: CreateJavaScriptAudioDevice
public JavaScriptAudioDevice CreateJavaScriptAudioDevice(IDevice audioDevice)
{
if (audioDevice == null)
return null;
return new JavaScriptAudioDevice(Engine, AudioController, audioDevice);
}
示例3: ActivityClient
public ActivityClient( string ip, int port, IDevice device, bool useCache = true )
{
LocalCaching = useCache;
InitializeEvents();
Ip = ip;
Port = port;
Address = Net.GetUrl( ip, port, "" ).ToString();
Device = device;
try
{
_eventHandler = new Connection(Address);
_eventHandler.JsonSerializer.TypeNameHandling = TypeNameHandling.Objects;
_eventHandler.Received += eventHandler_Received;
_eventHandler.Start().Wait();
}
catch(HttpClientException ex)
{
Console.WriteLine(ex.ToString());
}
}
示例4: OnDelete
protected override void OnDelete(IDevice device)
{
string s = string.Format(
"delete from tblDevice where DeviceID = {0}",
GuidHelper.ConvertToInt32(device.Guid));
DBI.Instance.ExecuteScalar(s);
}
示例5: IoTHubTransport
public IoTHubTransport(ISerialize serializer, ILogger logger, IConfigurationProvider configurationProvider, IDevice device)
{
_serializer = serializer;
_logger = logger;
_configurationProvider = configurationProvider;
_device = device;
}
示例6: SpeakerDetailsPage
public SpeakerDetailsPage(string sessionId, IDevice device)
{
this.sessionId = sessionId;
InitializeComponent();
MainScroll.ParallaxView = HeaderView;
ListViewSessions.ItemSelected += async (sender, e) =>
{
var session = ListViewSessions.SelectedItem as Session;
if(session == null)
return;
var sessionDetails = new SessionDetailsPage(session, device);
App.Logger.TrackPage(AppPage.Session.ToString(), session.Title);
await NavigationService.PushAsync(Navigation, sessionDetails);
ListViewSessions.SelectedItem = null;
};
if (Device.Idiom != TargetIdiom.Phone)
Row1Header.Height = Row1Content.Height = 350;
}
示例7: DeviceInitialize
public override void DeviceInitialize (IDevice device)
{
Volume = device as IVolume;
if (Volume == null) {
throw new InvalidDeviceException ();
}
if (!Volume.IsMounted && device.MediaCapabilities != null && device.MediaCapabilities.IsType ("ipod")) {
Hyena.Log.Information ("Found potential unmounted iDevice, trying to mount it now");
Volume.Mount ();
}
if (!Volume.IsMounted) {
Hyena.Log.Information ("AppleDeviceSource is ignoring unmounted volume " + Volume.Name);
throw new InvalidDeviceException ();
}
Device = new GPod.Device (Volume.MountPoint);
if (GPod.ITDB.GetControlPath (Device) == null) {
throw new InvalidDeviceException ();
}
base.DeviceInitialize (device);
Name = Volume.Name;
SupportsPlaylists = true;
SupportsPodcasts = Device.SupportsPodcast;
SupportsVideo = Device.SupportsVideo;
Initialize ();
GPod.ITDB.InitIpod (Volume.MountPoint, Device.IpodInfo == null ? null : Device.IpodInfo.ModelNumber, Name);
// HACK: ensure that m4a, and mp3 are set as accepted by the device; bgo#633552
AcceptableMimeTypes = (AcceptableMimeTypes ?? new string [0]).Union (new string [] { "taglib/m4a", "taglib/mp3" }).ToArray ();
// FIXME: Properly parse the device, color and generation and don't use the fallback strings
// IpodInfo is null on Macos formated ipods. I don't think we can really do anything with them
// but they get loaded as UMS devices if we throw an NRE here.
if (Device.IpodInfo != null) {
AddDapProperty (Catalog.GetString ("Device"), Device.IpodInfo.ModelString);
AddDapProperty (Catalog.GetString ("Generation"), Device.IpodInfo.GenerationString);
}
// FIXME
//AddDapProperty (Catalog.GetString ("Color"), "black");
AddDapProperty (Catalog.GetString ("Capacity"), string.Format ("{0:0.00}GB", BytesCapacity / 1024.0 / 1024.0 / 1024.0));
AddDapProperty (Catalog.GetString ("Available"), string.Format ("{0:0.00}GB", BytesAvailable / 1024.0 / 1024.0 / 1024.0));
AddDapProperty (Catalog.GetString ("Serial number"), Volume.Serial);
//AddDapProperty (Catalog.GetString ("Produced on"), ipod_device.ProductionInfo.DisplayDate);
//AddDapProperty (Catalog.GetString ("Firmware"), ipod_device.FirmwareVersion);
//string [] capabilities = new string [ipod_device.ModelInfo.Capabilities.Count];
//ipod_device.ModelInfo.Capabilities.CopyTo (capabilities, 0);
//AddDapProperty (Catalog.GetString ("Capabilities"), String.Join (", ", capabilities));
AddYesNoDapProperty (Catalog.GetString ("Supports cover art"), Device.SupportsArtwork);
AddYesNoDapProperty (Catalog.GetString ("Supports photos"), Device.SupportsPhoto);
}
示例8: StartLaunchMonitor
/// <summary>
/// Start looking for JDWP processes now.
/// </summary>
internal static void StartLaunchMonitor(IIde ide, IDevice device, string apkPath, string packageName, int apiLevel, int launchFlags, Action<LauncherStates, string> stateUpdate, CancellationToken token)
{
OutputPaneLog.EnsureLoaded(ide);
var newMonitor = new LaunchMonitor(ide, device, apkPath, packageName, apiLevel, launchFlags, stateUpdate, token);
monitor = newMonitor;
newMonitor.Start();
}
示例9: CapdEmulatorService
protected CapdEmulatorService(IDevice device)
{
this.device = device;
// Список для обратной связи.
callbacks = new List<ICapdControlEmulatorEvents>();
currentQuantum = new Quantum();
}
示例10: TestWindow
public TestWindow(IDevice device) {
Device = device;
InitializeComponent();
if (device != null && device.Tests != null) {
testTreeView.ItemsSource = device.Tests;
}
}
示例11: MainPage
public MainPage(MainViewModel mainViewModel, IDevice device)
{
_device = device;
InitializeComponent();
Setup(mainViewModel);
this.BindingContext = mainViewModel;
}
示例12: Config
public Config(ref IDevice[] devices)
{
InitializeComponent();
this.devices = new SimpleFileDevice[devices.Length];
this.outDevices = devices;
tbs = new TextBox[7];
tbs[0] = tbFile00;
tbs[1] = tbFileF1;
tbs[2] = tbFileF2;
tbs[3] = tbFileF3;
tbs[4] = tbFile04;
tbs[5] = tbFile05;
tbs[6] = tbFile06;
for (int i = 0; i < 7; i++)
{
if (devices[i] is SimpleFileDevice)
{
if (((SimpleFileDevice)devices[i]).fs != null)
tbs[i].Text = ((SimpleFileDevice)devices[i]).fs.Name;
this.devices[i] = (SimpleFileDevice)devices[i];
}
else
{
this.devices[i] = null;
tbs[i].Text = "Not a file device.";
}
}
}
示例13: SetDevice
public async Task SetDevice(IDevice device)
{
SetValue(devicePropertyKey, device);
SetValue(deviceNamePropertyKey, device.Name);
await SetDeviceInternal(device);
}
示例14: ConnectionManager
public ConnectionManager(ILogger logger,
ICredentialProvider credentialProvider,
INetworkConnection networkConnectivity,
IServerLocator serverDiscovery,
string applicationName,
string applicationVersion,
IDevice device,
ClientCapabilities clientCapabilities,
ICryptographyProvider cryptographyProvider,
Func<IClientWebSocket> webSocketFactory = null,
ILocalAssetManager localAssetManager = null)
{
_credentialProvider = credentialProvider;
_networkConnectivity = networkConnectivity;
_logger = logger;
_serverDiscovery = serverDiscovery;
_httpClient = AsyncHttpClientFactory.Create(logger);
ClientCapabilities = clientCapabilities;
_webSocketFactory = webSocketFactory;
_cryptographyProvider = cryptographyProvider;
_localAssetManager = localAssetManager;
Device = device;
ApplicationVersion = applicationVersion;
ApplicationName = applicationName;
ApiClients = new Dictionary<string, IApiClient>(StringComparer.OrdinalIgnoreCase);
SaveLocalCredentials = true;
Device.ResumeFromSleep += Device_ResumeFromSleep;
var jsonSerializer = new NewtonsoftJsonSerializer();
_connectService = new ConnectService(jsonSerializer, _logger, _httpClient, _cryptographyProvider, applicationName, applicationVersion);
}
示例15: ServiceList
public ServiceList (IAdapter adapter, IDevice device)
{
InitializeComponent ();
this.adapter = adapter;
this.device = device;
this.services = new ObservableCollection<IService> ();
listView.ItemsSource = services;
// when device is connected
adapter.DeviceConnected += (s, e) => {
device = e.Device; // do we need to overwrite this?
// when services are discovered
device.ServicesDiscovered += (object se, EventArgs ea) => {
Debug.WriteLine("device.ServicesDiscovered");
//services = (List<IService>)device.Services;
if (services.Count == 0)
Device.BeginInvokeOnMainThread(() => {
foreach (var service in device.Services) {
services.Add(service);
}
});
};
// start looking for services
device.DiscoverServices ();
};
// TODO: add to IAdapter first
//adapter.DeviceFailedToConnect += (sender, else) => {};
DisconnectButton.Activated += (sender, e) => {
adapter.DisconnectDevice (device);
Navigation.PopToRootAsync(); // disconnect means start over
};
}