compact-framework

Am I running on an Emulator or a Device

孤街浪徒 提交于 2019-12-11 04:05:22
问题 Is there a way (using managed code hopefully) to find out if I am running on an Emulator or an actual physical device? I am looking for something like this: public class BarcodeScannerFactory { public override BarcodeScanner GetBarcodeScanner() { if (IsARealDevice()) <---------------------------+ return new SymbolBarcodeScanner(); | else | return new FakeBarcodeScanner(); | } | } | | // This is the method I need to make ----------------+ (NOTE: It occurs to me that Windows Phone 7 has been

Datagrid programmatically unselect a cell

本小妞迷上赌 提交于 2019-12-11 03:55:12
问题 I am using a PDA in which I have a DataGrid that has a list of itemNames , barcode , and scanStatus . The user scans a barcode and I search in my DataGrid for a match and I select the row for the item that is associated with the barcode. I set the scanStatus to true . I was having a problem with the user touching the screen and the DataGrid's rows all got unselected. So I tried to handle the DataGrid's Click , DoubleClick , and the MouseUp events. I loop through my grid where scanStatus is

Trigger button click in .NET Compact Framework

我是研究僧i 提交于 2019-12-11 03:53:44
问题 Say I have a Panel with many Button and PictureBox controls. Each control has an associated Click event. This is a touchscreen application, so the user may be a little imprecise with their click (or the touchscreen calibration might not be perfect). So, I'd like to handle the click event on the panel and then programmatically call the Button's or PictureBox's Click event if the click is close to a button/picture. A number of other answers suggest using the "PerformClick" event, but this is

Throw event in the main thread from worker thread C# CF

喜你入骨 提交于 2019-12-11 03:46:28
问题 I have, what probably is, a simple problem. I'm using interop to call an asynchronous function in CompactFramework. After I get result of the execution, I would like to raise an event, that will be caught by the form, and based on the results, I would render some data on the screen. The problem, however, is that when interop function returns a result, it returns it on a worker thread, and if I raise an event, it will stay on the worker thread and I can't render any data in the form, unless I

SerialPort.Open() freezes the system if data was received previously (Compact Framework)

北城余情 提交于 2019-12-11 03:35:06
问题 I have a very weird problem here, maybe you guys can help me out. I have a Windows CE 6 device that uses a barcode card reader connected through a serial port. I'm using the Compact Framework's (v2.0) SerialPort class to handle this, and everything has been working fine. There's one problem, however. If a card is swiped at any point before the serial port is opened, the entire system freezes at the Open() call. No exceptions, no warnings, just a complete system freeze for no reason. I tried

Can I prevent garbage collector from stopping some of my threads?

隐身守侯 提交于 2019-12-11 03:03:09
问题 Is it possible in a Compact Framework application to prevent the garbage collector from unconditionally stopping at least one of the threads, or to block GC collects at least in some portions of the code? I think it has to deal with setting real time priorities, but I found a lot of advice against doing it. 回答1: The GC needs to freeze all threads in order to inspect all objects. How could it do its job, if some thread is running and is modifying/creating an object? Better don't do it. What

Programmatically set PIN/Password used to unlock device

隐身守侯 提交于 2019-12-11 02:48:38
问题 Our software allows the users to lock their Windows mobile 6 devices using the following API call. [DllImport("aygshell.dll")] public static extern int SHDeviceLockAndPrompt(); When deploying our software our client would like to be able to set a universal unlock PIN/Password for all of their users so that each device does not need to be set-up manually. Is there any way to set this either programmatically or through a reg key? 回答1: I'm not sure about the Shell function call you have

Windows Mobile to Zebra Printer over WLAN (ad hoc)

送分小仙女□ 提交于 2019-12-11 02:34:34
问题 I have an Intermec (CN3) Windows Mobile 5.0 device and a Zebra P4T printer. The printer does not have blue tooth. But the printer does have wireless capabilities that can be configured from a PC. http://j.imagehost.org/0665/printer_network_config.png The working environment does not have a wireless network that we can take advantage of. We are writing a .NET Compact Framework application that will run on the Intermec device and print to the Zebra printer over a wireless connection. What

DataGrid column size (Compact Framework) C#

两盒软妹~` 提交于 2019-12-11 01:47:58
问题 I'm new with DataGrids. My Code: private void populateGrid() { conn.Open(); string query; query = "select company_id_no, company_name, last_update_datetime, username from company"; OracleDataAdapter da = new OracleDataAdapter(query, conn); OracleDataSet ds = new OracleDataSet(); da.Fill(ds); dgSku.DataSource = ds.Tables[0]; } This is how it looks on my mobile device: I want it to automatically re-size the columns to 100%, like: I would really appreciate if someone can point me in the right

Run command line program silently with c# on wince

微笑、不失礼 提交于 2019-12-11 01:45:35
问题 I once again need some help. I'm using the .net Compact Framework and the programming language C# to develop for mobile devices that are running WinCE 5.0. What I want to accomplish is to programmatically mount a network drive. To do so, the app runs the following code in a background thread: ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "net"; startInfo.UseShellExecute = false; startInfo.Arguments = @"use logs \\server\logs /user:dom\uname /password:pw"; Process p