NumericUpDown Control and Selecting Text (Revisited)#

Back in Jan '06 I wrote an post on selecting the text of a NumericUpDown control.  Peter Morris pinged me the other day to let me know that he has updated the code provided and added support for Validation events.  It's great to see code being used by others and even greater to see when people like Peter share their changes back with the community.  Check out his updates here.

If you have used any code I've released via my blog, our Open Source products or any code from OpenNETCF partners either in production or just for a hobby project let me know and I can share your story!


Wednesday, July 23, 2008 11:53:37 PM (Eastern Daylight Time, UTC-04:00) #    Comments [0]  | 

 

Using Extension Methods in .NET CF 2.0#

Extension methods are a great addition to the C# 3.0 Language Specification as it allows you to extend a class by adding new methods and extend the class with features you desire.  For the .NET Compact Framework developer this is available in Visual Studio 2008 and .NET Compact Framework 3.5

At OpenNETCF we have a few developer products but are still using .NETCF 2.0.  Even a lot of our consulting jobs still use .NETCF 2.0 (and sometimes 1.0) but more customers are now wanting CF3.5.

Getting used to extension methods and then not being able to use them in pre .NETCF3.5 projects is not fun.  After doing a little search I found this were Daniel explains using extension methods in .NET 2.0 and how the compiler "figures things out". Basically the same thing applies for .NETCF 2.0.  You do require Visual Studio 2008 for this to work.

Basically what you have to do is add the following to your project:

namespace System.Runtime.CompilerServices
{
    public class ExtensionAttribute : Attribute
    {
    }
}

With that you can share extension methods you have written for .NETCF3.5 projects with .NETCF2.0 projects.

For example, I do a lot of custom drawing for controls on Windows Mobile and draw images with transparency.  Pre extension methods I would use something like this in .NETCF 2.0:

protected override void OnPaint(PaintEventArgs e)
{
    Bitmap image = new Bitmap(m_imagePath);
    ImageAttributes imageAtt = new ImageAttributes();
    Color transparentColor = image.GetPixel(0, 0);
    imageAtt.SetColorKey(transparentColor, transparentColor);
    e.Graphics.DrawImage(image, 
        new Rectangle(0,0,image.Width,image.Height), 
        0, 0, 
        image.Width, image.Height, 
        GraphicsUnit.Pixel, imageAtt);
    image.Dispose();
}

With the Attribute workaround above we create an extension method as follows:

public static void DrawImageTransparent(this Graphics graphics, 
    Bitmap image, 
    Rectangle destinationRect)
{
    ImageAttributes imageAtt = new ImageAttributes();
    Color transparentColor = image.GetPixel(0, 0);
    imageAtt.SetColorKey(transparentColor, transparentColor);
    graphics.DrawImage(image, 
        destinationRect, 0, 0, 
        image.Width, image.Height, 
        GraphicsUnit.Pixel, imageAtt);
}

And we can call it from our OnPaint method as follows:

using (Bitmap image = new Bitmap(m_imagePath))
    e.Graphics.DrawImageTransparent(image, new Rectangle(0, 0, image.Width, image.Height));

In the end we get a lot cleaner code and the extension method is portable to .NETCF3.5 and 2.0.


Wednesday, July 23, 2008 11:18:32 AM (Eastern Daylight Time, UTC-04:00) #    Comments [0]  | 

 

Canada's Wireless Spectrum Auction#

Similar to our friends down south, Canada recently just completed it's wireless spectrum auction.  A major difference I found is that the Canadian Government restricted the big three players (Rogers, Telus and Bell Mobility) to only bid 40% of the spectrum block to allow new players in the field.  Now that it's complete the Canadian government has raised $4.25billion and we now have a few more players in the field.  With more competition the state of the wireless industry in Canada can only get better. The recent data price drops are a good start!  Check out WirelessNorth.ca who has been covering the auction since it was announced and here for the final results.


Wednesday, July 23, 2008 10:17:23 AM (Eastern Daylight Time, UTC-04:00) #    Comments [0]  | 

 

New Mobility Chair for IAMCP Canada#

Starting July 1, 2008 I will be the new Mobility Chair for IAMCP Canada.  What is IAMCP, it stands for International Association of Microsoft Certified Partners and is a worldwide organization made up of Microsoft Partners from around the world.



The International Association of Microsoft Certified Partners (IAMCP) represents Microsoft's best of breed partners from around the globe. Our organization was formed in 1994 and provides Microsoft Partners a voice into Microsoft programs, to the IT community at large, as well as a vehicle to facilitate mutual growth and business development among partners. The non-profit organization is operated by an annually elected board of directors, an is funded through membership fees and sponsor grants.

So what does this all mean, well I pretty much be doing the same thing I've always done in terms of developers and Windows Mobile and now I can have some other partners along side of me doing the same thing.

It's going to be fun with all the new competition and RIM right in my back yard :)


Thursday, July 17, 2008 5:21:10 PM (Eastern Daylight Time, UTC-04:00) #    Comments [0]  | 

 

OpenNETCF Becomes Microsoft Gold Certified Partner#

It's my pleasure to announce that we have recently achieved Gold Certified Partner Level status within the Microsoft Partner Program in the Mobility Solutions and ISV Software Solutions competency. 

You can read the official press release here.

What exactly does this mean?  Well here is an excerpt from the partner web site:

Gold Certified Partners represent the highest level of competence and expertise with Microsoft technologies, and have the closest working relationship with Microsoft.

In my view it only means good things for our customers as this will allow us to strengthen our already existing relationship with various product groups within Microsoft.

Thanks goes out to all our customers who supported us through this process.

Here are some plaques we got for attaining the competency.

P1100011

P1100014


Tuesday, July 15, 2008 3:12:53 PM (Eastern Daylight Time, UTC-04:00) #    Comments [1]  | 

 

Microsoft MVP Award for 2008#

I have been recently awarded Microsoft Most Valuable Professional in Device Application Development.  What is an 'MVP'?  Here is an excerpt from the site:

  Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community's best and brightest, and they share a deep commitment to community and a willingness to help others.  

The other thing I've noticed is I'm the only Device Application Developer MVP in all of Canada (if I'm wrong please let me know also).  If you feel you fit the description of an MVP specifically in the Device Application Development category let me know.  See here for the selection criteria for the MVP Award.


Monday, July 14, 2008 11:19:59 AM (Eastern Daylight Time, UTC-04:00) #    Comments [0]  | 

 

Rogers Lowers Data Plan Rates#

When the iPhone pricing was first announced by Rogers the lowest cost you could get was $60/mth for 150minutes of talk time and 400MB (yes that's MB) of data with a minimum commitment of 3 years.  Oh and if you go over your talk time it's 0.35/minute and if you go over your data it's 0.50/MB.  Compare that to AT&T which offers the same phone for $70/mth, unlimited data and 450minutes.

With outrage from Canadian consumers (for some reason everyone wants an iPhone but me :) Rogers decided to give $30/mth for 6GB of data until August 31.  The best part about it is it's available on *all* smart phones including Windows Mobile.

The only thing I like about the iPhone is the effect it's having data prices in Canada.  I went from $100/mth for 1GB to $50/mth for 500MB to $30/mth for 6GB of data all within a span of 2.5mths.

So if you have a data plan with Rogers be sure to call them up and get this deal even if you don't have an iPhone. 


Friday, July 11, 2008 10:58:55 AM (Eastern Daylight Time, UTC-04:00) #    Comments [0]  | 

 

All content © 2008, Mark Arteaga
Related Sites
Archives
Sitemap
Disclaimer

Powered by: newtelligence dasBlog 1.9.7174.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts