ORM: Transactions are now supported

I’ve just checked in new code changes and rolled a full release for the OpenNETCF ORM.  The latest code changes add transaction support.  This new release adds a load of features since the last (the last was way back in February), most notably full support for SQLite on all of the following platforms: Windows Desktop, Windows CE, Windows Phone and Mono for Android.

OpenNETCF IoC now supports Mono for Android (MonoDroid)

In my push to get our fundamental libraries up and working on Mono for Android we’ve added support for OpenNETCF Extensions and OpenNETCF IoC.  What that means is that now you can have a common code for a lot of application infrastructure that works on the Compact Framework, the desktop, Windows Phone, MonoTouch for iOS and Mono for Android.  So you can now create a single, common code base for your applications that includes data access, event aggregation, dependency injection and inversion of control.


Get the latest code over on Codeplex.

OpenNETCF.IoC: New Release

We’ve been heavily dogfooding the IoC project (and others) lately and I finally took the time today to back-port the fixes and updates to the public code. This is being used for a solution that runs on both the desktop and the compact framework, so it’s been heavily tested under both of those environments. The new release (1.0.11235) is now available on Codeplex.

Another Open Source Project: OpenNETCF Extensions

Like most people, the more projects I work on the more I find myself reusing common bits and pieces of code. For the past year or so I’ve been collecting these pieces into a library I called OpenNETCF.Extensions.  The name was becasue they originally started as a set of extension methods that helped me to compile one code base for Windows Phone, the Compact Framework and the full framework, but it eventually started expanding in scope.  I added a fairly robust set of method for validation, a set of classes for helpiing make REST clients, a class for a circular buffer (FIFO) and generally anything I found myself using on multiple projects.


Since many of those projects are already open-source, it started becoming a pain maintaining a single, controlled source for these helpers.  So in an attempt to centralize it, I’ve created yet one more open source project.  My plan now is to have all of the consuming projects only use binary releases from this project.


So, with that said, go ahead and check out the new MIT-licensed OpenNETCF Extensions project over on Codeplex.

MTConnect SDK Refresh Released

 



I’ve again refreshed OpenNETCF’s MTConnect Managed SDK with a few changes, including:



  • Added support for some current and sample filtering (not all filtering is supported, but I’ve added device name and data item ID filtering)
  • Added AgentInformation to the EntityClient so you get information about the agent returning a data set for a probe
  • Miscellaneous bug fixes and refactoring

As always, if you find a bug or would like me to work on implementing a specific feature from the specification, add it to the lists over on the Codeplex site.

MTConnect Managed SDK now supports Windows Phone 7

 



OpenNETCF’s MTConnect Managed SDK now has Common and Client projects supporting Windows Phone 7.  This means you can now consume MTConnect-published data in your Phone 7 projects.  I’ll also be publishing and open-sourcing an MTConnect viewer for Phone 7 in the future, but if you want to get started on your own, you now have the tools.

HttpWebRequest.GetResponse and GetRequestStream in Windows Phone 7

Windows Phone 7, at least on the Silverlight side of things, is very heavily biased toward asynchronous API calls.  While that’s all well and good, it makes porting existing code assets to the Phone a bit more challenging. 


One place I recently ran into was in making synchronous calls to HttpWebRequest.GetResponse and GetRequestStream.  These methods don’t exist in the Phone 7 SDK – instead you should use BeginGetResponse and BeginGetRequestStream.  Well my code was written to use the synchronous versions and is shared with CF and FFx applications, so rewriting the calling code isn’t terribly appealing. Instead I simply added the following extensions to the project:


 

namespace System.Net
{
public static class HttpWebRequestExtensions
{
#if WINDOWS_PHONE
private const int DefaultRequestTimeout = 5000;

public static HttpWebResponse GetResponse(this HttpWebRequest request)
{
var dataReady = new AutoResetEvent(false);
HttpWebResponse response = null;
var callback = new AsyncCallback(delegate(IAsyncResult asynchronousResult)
{
response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
dataReady.Set();
});

request.BeginGetResponse(callback, request);

if (dataReady.WaitOne(DefaultRequestTimeout))
{
return response;
}

return null;
}

public static Stream GetRequestStream(this HttpWebRequest request)
{
var dataReady = new AutoResetEvent(false);
Stream stream = null;
var callback = new AsyncCallback(delegate(IAsyncResult asynchronousResult)
{
stream = (Stream)request.EndGetRequestStream(asynchronousResult);
dataReady.Set();
});

request.BeginGetRequestStream(callback, request);
if (!dataReady.WaitOne(DefaultRequestTimeout))
{
return null;
}

return stream;
}
#endif
}
}