MailMessage tool for sending any attachments at Windows Phone.

Just for fun or maybe every C# developer should play with Windows Phone; however I’ve started to develop my Windows Phone application. I wouldn’t say about an idea of the application, but as usual there are an email sending and some social functions.

I was really surprised that EmailComposeTask can’t send any types of attachments and EVER html! The reason of it is that all Tasks at Windows Phone SDK are limited by 64k (for example EmailComposeTask’s message body can’t exit of this size).

So I was thinking about following approach:

  • send data to a web service that forwards the file to an email address;
  • upload file to the some cloud storage;

Fortunately I’ve found a great tool which solved all these obstacles. This is a MailMessage (now there is a 1.2.1 version). You can easily send any type of attachments (pdf, mp3, wav, mp4, avi, bmp, txt, zip, jpg, png…) from your application and ever html with the MailMessage library.

Also it has an extremely fast and good support (which is on my opinion the one of the significant characteristic of good tool). I don’t want to add some code example here because everything what you need you can find at product page.

Thanks for the great tool!


Team Foundation Service at the cloud. Setup continuous integration with Microsoft and non-Microsoft test provider

Today I’d like to write about a new offer from Microsoft — Team Foundation Service in the cloud. For now everything is free so this is a great time to play with this technology.

After great success of cloud-version source control I was 100% sure that Microsoft has to react and give their service. Especially because they have already a good product like TFS (after Perforce I really love TFS J). As I said for now TFS is a preview so everything is free. At 2013 a new price will be announcing. However, free plan will include max 5 users at system and some limit for builds (which in my opinion — ideally for small start-ups and freelancers). Previously I used Dropbox + SVN for all my freelance/home projects. Then I’ve switched almost everything to Bitbucket. However, all of this solutions don’t have continuous integrations, test runner and project planning (especially for agile, where TFS always was much-much better then jira).

In this article I’d like to show how easily we can create a simple application, host it at TFS in the cloud, setup continuous integration for each check-in and use not Microsoft test framework. Continue reading

Refactoring with Microsoft Visual Studio 2010

Until this time I tried not write any post about book review but this book is unique. Of course like every developers I make a plan for year. And of course there is an item about some amount of books which I have to read (in this year I must read 15 technical books). When I changed the company and became team leader I unfortunately don’t have a lot of time but plan – it’s plan J

However I couldn’t write a review on “Refactoring with Microsoft Visual Studio 2010” by Peter Ritchie.Refactoring with Microsoft Visual Studio 2010

I’ve just closed a book which I was reading a few weeks. I was really impressed! I didn’t expect this at all: a way to learn the tool in the context of design patterns. It isn’t just something to read to understand the tools provided to you from VS2010, it’s a book about patterns and practices for power programming. With this book you will look at an assortment of techniques in great detail. You will study how these patterns can be used to change the way your software is designed.

What this book covers

Chapter 1, Introducing Refactoring, describes what refactoring is, its importance, and its priority in the software development effort. Comparison to re-writing and what “Technical Debt” is and how refactoring can be used to pay down technical debt is covered in this chapter.

Chapter 2, Improving Code Readability, begins detailing the refactoring’s built in to Visual Studio and how they can make code more readable. Code smells are introduced, and which code smells apply to readability, and how to detect and refactor them are detailed in this chapter.

Chapter 3, Improving Code Maintainability, continues to detail the refactoring’s built in to Visual Studio and how they can make code more maintainable. Code smells that apply to maintainability, how to detect and refactor them are detailed in this chapter. The importance of unit testing is covered in this chapter.

Chapter 4, Improving code navigation, continues with simple refactoring’s and how code can be refactored to improve its navigability in general and takes into account Visual Studio code navigation abilities.
Chapter 5, Improving design correctness, begins detailing complex refactoring’s. Design principles such as Liskov Substitution and Composition over Inheritance are introduced and how to perform refactoring’s related to these principles is covered in this chapter.

Chapter 6, Improving class quality, introduces code quality metrics like cohesion and coupling. Principles related to cohesion and coupling are introduced and refactoring’s that increase cohesion and decrease coupling are covered in this chapter.

Chapter 7, Refactoring to loosely-coupled, expands on coupling from the previous chapter and drills-down on loosely-coupled design. Principles related to loosely-coupled are introduced and complex refactoring’s related to loosening coupling are covered in this chapter.

Chapter 8, Refactoring to layers, continues with more complex refactoring’s that involve layered architectures. Typical layers, Model View Presenter, and Repository patterns and how and when to refactor to them are also detailed in this chapter.

Chapter 9, Improving architectural behavior, details complex refactoring’s to improve architectural behavior. Design behavior patterns, when and how to refactor to them are detailed in this chapter.

Chapter 10, Improving architectural structure, continues with architectural-related complex refactoring’s. Object-Relational Mapping (ORM) and refactoring Repository implementations are included in this chapter.

Chapter 11, Ensuring Quality with Unit Testing, details the importance of unit testing. How unit testing applies to refactoring, examples of unit testing to support the refactoring effort and legacy code are also detailed in this chapter.

I consider “Refactoring with Microsoft Visual Studio 2010” as one of the first books which I’ll recommend a good .NET-developers!

The ADO.NET Entity Framework 4.1 and Code First.

The ADO.NET Entity Framework 4.1 was released in April. There are a lot of interesting features. However the most fantastic one, I suppose, is a Code First development.

In my previous application we had to use a nHibernate because we were needed to create a database dynamically when the application is running. So when Microsoft announced a Code First feature I spent lots of time on this.

And today I discovered a really good article in the new May’s MSDN magazine.

I hope this is a nice place to start with understanding of Code First.

Disable XAML Designer in Visual Studio 2010

XAML designer is always opened by default in Visual Studio. I don’t like this behavior. Especially because I usually use just Xaml mode without Design mode.

So please don’t waste your time on closing this window each time and switch off it eventually. You can do it by selection following option:

Tools -> Options -> Text Editor -> XAML -> Miscellaneus

And select “Always open documents in full XAML view” under.

Python Tools for Visual Studio

Last 6 months I’m looking not only Microsoft technologies. I’m using Objective-C and Python languages now.

I’ve awesome news: Microsoft released a new beta of the Python Tools for Visual Studio.

Python Tools for Visual Studio is a free & open source plug-in for Visual Studio 2010. The Python tools are put together by a small team from Microsoft’s Technical Computing Group and released on Codeplex.

An integrated environment for developing Python in VS2010

  • Advanced editing, Intellisense, browsing, “Find all refs”, REPL, …
  • Supports CPython and IronPython
  • Local & Cluster/remote debugging
  • Profiling with multiple views
  • Interactive parallel computing via integrated IPython REPL
  • Support for HPC clusters and MPI, including debugging support
  • NumPy & SciPy for .Net
  • Support for Cloud Computing (soon)
  • Support for Dryad (large scale, data-intensive parallel programming) (soon)
  • Free & Open Source (Apache 2.0)

There are a few screens: