compact-framework

Value does not fall within the expected range

烂漫一生 提交于 2019-12-03 22:23:23
Error when trying to display the form designer. See picture of the error: Code of the screen: public partial class frmCanalVenda : frmEdit { public frmCanalVenda(CanalVenda canal, Cliente cli) : base(canal) { InitializeComponent(); bdsCliente.DataSource = cli; eabBar.ReadOnlyView = false; } private void frmCanalVenda_Load(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; bdsAgrupamento.DataSource = Agrupamento.GetAll(DatabaseAFV.Connection); bdsCanal.DataSource = Canal.GetAll(DatabaseAFV.Connection); bdsSubCanal.DataSource = SubCanal.GetAll(DatabaseAFV.Connection);

In C#, how can I tell if a property is static? (.Net CF 2.0)

情到浓时终转凉″ 提交于 2019-12-03 22:09:42
FieldInfo has an IsStatic member, but PropertyInfo doesn't. I assume I'm just overlooking what I need. Type type = someObject.GetType(); foreach (PropertyInfo pi in type.GetProperties()) { // umm... Not sure how to tell if this property is static } To determine whether a property is static, you must obtain the MethodInfo for the get or set accessor, by calling the GetGetMethod or the GetSetMethod method, and examine its IsStatic property. http://msdn.microsoft.com/en-us/library/system.reflection.propertyinfo.aspx ctacke Why not use type.GetProperties(BindingFlags.Static) Better solution public

Debug .NET Compact Framework app locally (without emulator or device)

拜拜、爱过 提交于 2019-12-03 21:45:19
问题 I am currently in the preparation phase for a new project that will be developed with .NET Compact Framework (2.0 or 3.5, we'll see) and will run on a custom Windows CE 6 hardware. There is, however, one thing I can't get to work: Debugging seems to be possible only with a physical device or with the emulator. But when I just start the app from explorer, it runs happily on my desktop (because, of course, the CF is installed on my development machine. So, the actual question is: How can I

Notification when my form is fully loaded in C# (.Net Compact Framework)?

纵然是瞬间 提交于 2019-12-03 21:41:19
I have a form in my application and I want to do some processing when my form has been Fully loaded but I have no event or something which I can bind to when load is finished. Does anyone has any idea, how can I do this? What exaclty mean "fully loaded" ? Do you mean, the "Load" event was successfully proceeded? You can do this: public class MyForm : Form { protected override void OnLoad( EventArgs e ) { // the base method raises the load method base.OnLoad( e ); // now are all events hooked to "Load" method proceeded => the form is loaded this.OnLoadComplete( e ); } // your "special" method

What is the best way to make a single instance application in Compact Framework?

偶尔善良 提交于 2019-12-03 20:40:50
I've seen all the answers for the standard framework What is the correct way to create a single instance application? Prevent multiple instances of a given app in .NET? What is the best way to make a single instance application in .net? How do I check whether another process with the same name exists using the compact framework? The 3 parameter constructor is not supported by the CF Process GetProcessByName is not supported by the CF OpenNETCF gives you class OpenNETCF.Threading.NamedMutex that let's you create system-wide named mutex. http://www.opennetcf.com/library/sdf/html/40db385b-e21b

Detecting network state (connected - disconnected) in C#

偶尔善良 提交于 2019-12-03 20:22:14
问题 I am in need of a piece of code that can detect if a network connection is connected or disconnected. The connected state would mean a cable was plugged into the Ethernet connection. A disconnected state would mean there is not cable connected. I can't use the WMI interface due to the fact that I'm running on Windows CE. I don't mind invoking the Win32 API but remember that I'm using Windows CE and running on the Compact Framework. 回答1: Check out this MSDN article: Testing for and Responding

Anti aliasing DrawLine on CE

穿精又带淫゛_ 提交于 2019-12-03 20:14:34
I am drawing a line to a Graphics object in Windows CE using C#.NET 3.5. The code I am using looks like this: e.Graphics.DrawLine(new Pen(Color.FromArgb(11, 118, 200), 2), x1, y1, x2, y2); This works however looks terrible due to jaggies etc. Is there anyway I can draw anti aliased lines? From what I can tell the Graphics object doesn't support this natively but is there anyway to "cheat" this effect using some trickery? A fast trick if you're drawing on a solid color background, you can draw a line with a thicker pen and a color in between the background color and the line color prior to the

C# in VS2005: Can a device project target both full framework and CF?

青春壹個敷衍的年華 提交于 2019-12-03 19:34:40
We're developing with Compact Framework for a device under Visual Studio 2005. However we want to make an emulated version of the software as well, running at the PC (preferably selectable via a Build Configuration). It seems however that the .vsproj file is specific for devices; there is no way to use the full .NET framework for example by just changing the target. Is there any way around this? I suppose we can run the compact framework on the PC, but still the project can't target for example an ARM processor or else I assume the JIT compiler will generate unusable code for the PC? You can

Why is my CE app refusing to run?

元气小坏坏 提交于 2019-12-03 18:18:21
问题 I've been maintaining a Windows CE app for some time now (over a year) and have produced new versions of it from time to time, copying them to the handheld device[s] and running the new versions there. Today, though, I created a new Windows CE app for the first time. It is a very simple utility. To create it in VS 2008, I selected a C# "Smart Device Project" template, added a few controls and a bit of code, and built it. Here are some of the options I selected: I copied the .exe produced via

How can I expose only a fragment of IList<>?

痴心易碎 提交于 2019-12-03 17:22:57
问题 I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I pass a part of this ReadOnlyCollection<> without copying elements into a new array (I need a live view, and the target device is short on memory)? I'm targetting Compact Framework 2.0. 回答1: Try a method that returns an enumeration using yield: IEnumerable<T> FilterCollection<T>( ReadOnlyCollection<T> input ) { foreach ( T item in input ) if ( /* criterion is met */ )