compact-framework

Resize images in Windows Mobile

与世无争的帅哥 提交于 2019-12-25 04:46:21
问题 Is there anyone who knows a way to resize images on the .net 2.0 Compact Framework? I want to be able to get images, taken with the camera on my phone, from the phones memory, resize them and then upload them to a webservice so I acctually don't need to store the resized images on disk. 回答1: This is the C# code I use to resize images in my .NET CF 2.0 applications: public static Image ResizePicture( Image image, Size maxSize ) { if( image == null ) throw new ArgumentNullException( "image",

Wcf proxy generation on windows mobile application

天大地大妈咪最大 提交于 2019-12-25 04:42:18
问题 For my mobile app, I used the Add Web References to generate the client proxy to interact with my WCF service. Then I read somewhere there is an equivalent of SvcUtil for compact framework: NetCFSvcUtil. Should I be using the NetCFSvcUtil instead of going throught the Add Web References? Or the Add Web References uses NetCFSvcUtil in the background? Any pros/cons of one or the other? 回答1: Add web reference should be old proxy based on ASMX web services whereas NetCFSvcUtil is tool to generate

Choose appropriate platform dependent DLL at runtime

廉价感情. 提交于 2019-12-25 04:41:27
问题 I'm currently working on project for the .NET Compact Framework which uses DotNetZip for reading ZIP-files. The project is split into two parts. One platform-independent library which should be available for both, a CF project and a desktop project. This common library contains the code for extracting ZIP-files. The problem is that there are two different DLLs of the DotNetZip library, one for .NET CF and one for the .NET Desktop Framework. It's not possible to use the CF version of the

C# - Why can I not cast a List<MyObject> to a class that inherits from List<MyObject>?

有些话、适合烂在心里 提交于 2019-12-25 04:33:30
问题 I've got an object, which I'll call MyObject. It's a class that controls a particular data row. I've then got a collection class, called MyObjectCollection: public class MyObjectCollection : List<MyObject> {} Why can I not do the following: List<MyObject> list = this.DoSomethingHere(); MyObjectCollection collection = (MyObjectCollection)list; Thanks in advance. Edit: The error is InvalidCastException 回答1: My guess is that DoSomethingHere doesn't return an instance of MyObjectCollection . Let

.Net Compact Framework 2.0: Deploying an app

送分小仙女□ 提交于 2019-12-25 02:29:16
问题 I was used to building on .Net Compact Framework 1.0 with VS 2003 where you had the option to "build CABs" for your project, which is handy because I am sending the app to a remote site. Now this project was rebuilt with VS 2005 and I don't have this same "build CABs" option. Is the deployment model with VS 2005 just to send the contents of the bin\Release folder? 回答1: For VS 2005 I would add a Smart Device CAB project to the solution and create the CAB with that using the primary output of

Intercepting the value change of SetChildIndex

妖精的绣舞 提交于 2019-12-25 02:24:54
问题 In a .NET CF-form i have multiple panels. I want to have a property that should always be informed about if a panel is in the front. Can this be done using the GetChildIndex() method? If yes, how do i intercept the change to SetChildIndex()? Thanks in advance 回答1: For everybody who is interested for future use: simply add a new event handler for the Paint event of each panel, for example: panel1.Paint += new PaintEventHandler(panel1_Paint); panel2.Paint += new PaintEventHandler(panel2_Paint);

Is there a way to obtain the HTML of a web page using the .NET compact framework?

元气小坏坏 提交于 2019-12-24 21:18:19
问题 As the WebBrowser control does not expose a get accessor for the DocumentText property you cannot use it to obtain the HTML that was loaded into this control. Does anyone know a way to obtain the HTML as a string? I am using .NET CF3.5. 回答1: Use HttpWebRequest class. Here is an example on how to do that. 回答2: Have you tried WebBrowser.Document? System.Windows.Forms.HtmlDocument document = this.webBrowser1.Document; It's exposed as: [BrowsableAttribute(false)] public HtmlDocument Document {

Is this the right way to query a SQL Server CE table for a record, populating and returning a custom object?

家住魔仙堡 提交于 2019-12-24 19:29:47
问题 The code below works, but I'm wondering if it's more loquacious than necessary: public static InventoryItem SelectLocalInventoryItem(string ID) { const int ID_COL = 0; const int PACKSIZE_COL = 1; const int DESCRIPTION_COL = 2; const int DEPTDOTSUBDEPT_COL = 3; const int UNITCOST_COL = 4; const int UNITLIST_COL = 5; const int UPCCODE_COL = 6; const int UPCPACKSIZE_COL = 7; const int CRVID_COL = 8; var invItem = new InventoryItem(); using (var conn = new SqlCeConnection(dataSource)) { var cmd =

C# Compact-Framework friendly command line parser

陌路散爱 提交于 2019-12-24 18:38:26
问题 I read this question: Command Line Parser for .NET. I thought that was what I was looking for, but the library Command Line Parser Library is not Compact framework friendly... I REALLY don't want to write a CL parser and I have been drifting away from the real purpose of my little app because of this unfortunate trial. Does someone know of a library that fits the compact-framework? (preferably with simplicity and functionality like the one mentioned above) Does not matter whether version 2 or

Are optional params available for the Compact Framework?

大城市里の小女人 提交于 2019-12-24 12:01:11
问题 I need to get a list of all files on a handheld device whose names fit a certain pattern, such as " ABC .XML" I adapted code from here (Hernaldo's answer), like so: public static List<string> GetXMLFiles(string fileType, string dir) { string dirName = dir; // call it like so: GetXMLFiles("ABC", "\\"); <= I think the double-whack is what I need for Windows CE device...am I right? var fileNames = new List<String>(); try { foreach (string f in Directory.GetFiles(dirName)) { if ((f.Contains