compact-framework

DI: Handling Life of IDisposable Objects

风流意气都作罢 提交于 2019-12-04 11:18:58
问题 So I'm working on my DI/IoC Container OpenNETCF.IoC and I've got a (reasonable) feature request to add some form of lifecycle management for IDisposable items in the container collections. My current thinking is that, since I can't query an object to see if it's been disposed, and I can't get an event for when it's been disposed, that I have to create some form of wrapper for objects that a developer wants the framework to manage. Right now objects can be added with AddNew (for simplicity

.net compact framework: Avoid program being started twice concurrently

馋奶兔 提交于 2019-12-04 11:14:25
How can I avoid that a user starts the same program twice? The current implementation tries to do that using "FindWindow", but since it takes some time before the program opens the first window, users regulary manage to start the program twice, causing errors etc. You have to use a named mutex so it can be used across processes. For whatever (stupid) reason, the CF designers figured CF developers would never need such a thing, so you have 2 options: P/Invoke CreateMutex and the associated clean up stuff Use an already written implementation like the SDF's NamedMutex class (which simply does #1

Ignoring queued mouse events

守給你的承諾、 提交于 2019-12-04 11:04:44
问题 I have an application written in C# targeting .NET Compact Framework 3.5, running on Windows CE. From time to time, operations lasting for a second or so are being performed on the UI thread. I currently set the Cursor.Current property to indicate that the application is busy, but this does not prevent mouse events from eager users to queue up. This sometimes leads to unintended clicks. What is the best way to ignore queued mouse messages on the .NET Compact Framework platform? Sadly, the

Automated GUI Testing .NET CF (Windows Mobile 5)

こ雲淡風輕ζ 提交于 2019-12-04 10:04:48
My company is looking into using automated GUI testing for our current app before proceeding to alpha. Our current main focus is robustness testing, one way we want to achieve this is automated UI testing that can be repeated over several hours/days. For our desktop version we've decided on AutomationElement, and I've seen several free open source frameworks. For .NET CF the options seem more limited. I found M-eux Test , but the license fee is a little bit steep. I also found Test Complete 7 , which I am planning on looking into. The tests will be written by programmers. Support for being

How do I include the .NET Compact Framework as part of a Smart Device CAB Project?

允我心安 提交于 2019-12-04 09:47:51
问题 I'm working on a VS2008 Smart Device app that includes a Smart Device CAB Project for deployment. I was surprised to find out that this installer project doesn't install the .NET Compact Framework if necessary. Can it be made to do so? 回答1: It can be done with some work. See Automatically Install Multiple CAB Files to a Windows Mobile/Pocket PC Device from codeproject.com 回答2: There is no way to get a CAB Project to install and run another CAB file - it's a limitation of the CAB installer

Rhino Mocks & Compact Framework

若如初见. 提交于 2019-12-04 08:51:54
I've been experimenting with Rhino Mocks for unit testing my .Net Compact Framework application, and have hit a problem. I can get a basic unit test using Rhino Mocks built, but every time I run the test that has the Rhino Mocks code in it, the test fails because it can't find the Rhino Mocks assembly. System.TypeLoadException: Could not load type 'Rhino.Mocks.MockRepository' from assembly 'Rhino.Mocks... I've copied the rhino mocks dll to various places on the device (my app folder, and the SmartDeviceTest folder that gets created) but it still can't seem to find it. Has anyone used rhino

Handling Different Resolutions in Visual Studio 2008 for .NET CF

笑着哭i 提交于 2019-12-04 07:35:39
I am developing a .NET CF based Graphics Application, my project involves a lot of drawing images, We have decided to go for porting the application on different handset resolution.(240 X 240 , 480 X 640) etc. How would i go onto achieve this within single solution/project? Is there a need to create different projects based on resolutions? How would i handle common files? and i need the changes in one of the common classes to occur across all devices. Thank you, Cronos Don't listen to that idiot MusiGenesis. A much better way of handling different screen resolutions for Windows Mobile devices

Clear combobox datasource items

怎甘沉沦 提交于 2019-12-04 07:30:04
Combobox datasource has been assigned with cmbCombobox.DataSource = myCollection where myCollection has type MyCollection: List How can I clear items in combobox? When you data bind a control, it will synchronize with that collection. In order to clear the items in your ComboBox set it's DataSource to null. cmbComboBox.DataSource = null; If your combobox is not databound (no DataSource) then you can do cmbComboBox.Items.Clear(); Andrew http://support.microsoft.com/kb/327895 Me.ListBox1.DataSource = Nothing This works for me. VB incorrectly advises the use of DBNull (which crashes). Here is how

Using a X509 Certificate in .Net Compact Framework for Client Authentication HTTPRequest

£可爱£侵袭症+ 提交于 2019-12-04 05:27:43
I'm working in Windows Mobile 6 and would like to have client authentication when talking to a Apache webserver. I have a certificate in my local certificate store and it should be rather straightforward: X509Store myStore = new X509Store("MY", StoreLocation.CurrentUser); myStore.Open(OpenFlags.ReadOnly); X509Certificate2Collection certificates = myStore.Certificates; X509Certificate2 clientcertificate; foreach (X509Certificate 2certificate in certificates) { clientcertificate = certificate; //omitted code to validate certificate } HttpWebRequest req = (HttpWebRequest)WebRequest.Create(webPage

No Signs of Fatal Exception when application crashes | NLog version 2 | Compact Framework 3.5

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 05:26:44
问题 I have a .Net Compact Framework 3.5 application that uses Nlog version 2.0 to log Info, Error and Fatal Exceptions. Most of the time the logging works as expected and logs fatal exceptions before crashing. But at times it is observed that application crashes without leaving any signs of an error/exception. Let me elaborate the scenario: The Application creates few threads, all the threads have try-catch block added at the beginning of their call stacks. And hence log fetal exceptions before