Tag | C# Posts

In my previous post we talked about how to create app in Wearable and Handheld devices and created a simple implementation of sending/syncing data. In this post I'm going to demonstrate how to deploy and test apps in real device. First of all I am using Nexus 9 and LG G Watch as my test devices. Before we start make sure that USB Driver for Android is installed in your machine. You can verify it by right clicking on the COMPUTER > MANAGE > DEVICE MANAGER > OTHER DEVICES. If the driver isn't ...
I have blogged about how you can use WebAPI 2 hosted on OWIN with legacy applications. Visit the link below for more information. http://blogs.msdn.com/b/afr... Technorati Tags: WebAPI,AfricaApps,OWIN,JSON... ...
Testing an application is not what most people consider fun and the number of situation that need to be tested seems to grow exponentially when building mobile apps. That is why I found the topic of this session interesting. When I found out that the speaker, Francis Cheung, was from the Patterns and Practices group I knew I was in the right place. I have admired that team since I first met Ron Jacobs around 2001. So what did Francis have to offer? He started off in a rather confusing who’s on first ...
Win32 API offers a lot of functionality for Windows platform, which the .NET Framework doesn’t have for good reason – One of them being ‘managed’. However, that doesn’t stop us from doing some unsafe things! We can always build a wrapper for Win32 API and then call those functions directly from .NET. Let us evaluate one of such area which requires calling Win32 API functions from .NET. That area is ‘Simulating UI Automation’. Of course, the subject is too vast to fit in a single blog post, however, ...
If you’re familiar with NetSqlAzMan or CanCan, you know that checking permissions based on a user’s activities is easier to manage and more flexible that working with the roles a user is in. Whatever method you take to add activity based authorization, if you are working in MVC you will run into the issue that AuthorizeAttribute only cares about Users and Roles. The good news is that you can inherit from AuthorizeAttribute and easily adapt it to account for activity-based authorization. If you didn’t ...
Assembly is the smallest unit of deployment in .NET Framework. When you compile your C# code, it will get converted into a managed module. A managed module is a standard EXE or DLL. This managed module will have the IL (Microsoft Intermediate Language) code and the metadata. Apart from this it will also have header information. The following table describes parts of a managed module. Part Description PE Header PE32 Header for 32-bit PE32+ Header for 64-bit This is a standard Windows PE header which ...
Sometimes as developers we’re spoiled by third parties that do a lot of the heavy lifting for us. However, sometimes we’re NOT spoiled and we have to get our hands dirty. Today, I spent much of the day getting my hands dirty. I’m working on a project that uses a MagTek credit card swiper and all MagTek provides you in terms of dlls is a c++ dll and an ActiveX dll. What fun is that? I wanted to avoid com interop (no, I don’t have a good reason) and write a C# class that handled talking with their ...
It’s really exciting news that new SDK V1.5 Kinect for Windows was released on May 21st 2012. There are lot of new features and enhancement made as part of this release. Let me highlight few here and I will try to come up with some demo we can explore them in more detail. 1. Seated mode skeletal tracking was included in this release, which can track upto 10 joints. 2. Improved skeletal tracking in near mode and better performance. Also joint orientation info to determine simple pose detection, which ...
In a previous post I talked about using the JSON to LINQ features of JSON.NET. Thanks to Bil Simser I was able to do some testing of the deserialization capabilities of this library. The key was his hint to leverage the json2csharp web site. Below is the C# representation of the search results for a Twitter query created by putting an example of the search result into this site. public class Url{ public string url { get; set; } public string expanded_url { get; set; } public string display_url { ...
Introduction I’m sure by now you have heard that the Kinect SDK has been released by Microsoft. I recently had a chance to Guest Blog for the Microsoft MVP Award Program Blog on “Getting the Most out of the Kinect SDK”. Now before we get started learning about it, let’s look at what it is: *Kinect for Xbox 360, or simply Kinect (originally known by the code name Project Natal),[8] is a motion sensing input device by Microsoft for the Xbox 360 video game console. Based around a webcam-style add-on ...
During the last months, I was (for some reasons that are not related to programming) working for a dev shop where software development was done the 'traditional' way: You just write your application's production code, do it as good as you can, and hopefully it will be good enough and no problems will occur in production (this is HDD: Hope-driven development). Anyway, after I had finished this contract, I felt the need to review some core aspects of what I think is Test-driven development. And while ...
· For the last decade, the majority of my dev work has leveraged the .NET Framework for construction of information systems. However, my interest has lain in numerical computing. · Is it possible to have an increasingly higher level of abstraction and at the same time achieve underlying high performance computing? The prevailing winds say no: C# is aimed at productivity, and C++ is for performance. Garbage collection was great, but do we still need it with the availability of smart pointers? Would ...
Introduction In case you missed it, I have a 10-part series on Silverlight 5 on SilverlightShow.net. In this extensive guide to Silverlight 5, I give a step-by-step introduction to Silverlight 5, and dives into the features most important to a Silverlight developer. You can check out the first 3 parts now and I will be adding a new one each week. The Roadmap for this Series I’ve included the Roadmap for the series below as you may want to visit other sections as you learn Silverlight 5. I picked ...
The following is my experience with SSIS building: Make sure you understand the 3 modes of Lookup. General, I would only do full cache if the lookup table only return less than 200 rows Never use the table or view select unless you really need every field on that table or view. select * from a data source will break in the future if more columns are added to the table select * in a lookup brings back unnecessary fields and impact performance Never use "Sort" in SSIS unless it's absolutely necessary. ...
Today's 50% off deal from O'Reilly at http://shop.oreilly.com/pro... is Coding Faster: Getting More Productive with Microsoft® Visual Studio® "Expert advice to help you work smarter and increase your productivity with Visual Studio. Take a detailed look into Visual Studio—and learn practical techniques to help you work more efficiently. This fully revised and expanded version of Visual Studio Tips: 251 Ways to Improve Your Productivity includes a comprehensive collection of tips ...
Recently I heard from a reader of the blog about an alternative to GhostDoc - the Atomineer Utils Addin at http://www.atomineerutils.com/ Besides working with C# and Vb.NET it does also handle C++ and J***. Should you be a J*** fan then this could be a very useful utility. There is a feature comparison with respect to ghostDoc at http://www.atomineerutils.c... There is a 30-day evaluation available at http://www.atomineerutils.c... The single-user license of $9.99 and the annual ...
UPDATED Jul 3rd 2013: Added Art of Unit Testing Version 2 UPDATED Apr 11th 2013: Added Instant TFS 2012 and Project Server 2012 Integration How-to UPDATED Jan 12th 2013: Added Prof TFS Server 2012, TFS 2012 Starter, Pro ALM with VS 2012 and VS 2012 Cookbook UPDATED Dec 8th 2011: Added Kanban book by David Anderson “Send me a list of books to read” – that is what I am often asked. No more, as this list is an answer to those request! I have divided it into different subject areas, and each area hold ...
DropkicK (DK) has been in development for over two years and has been used for production deployments for over a year. Dru Sellers originally posted about DK back in 2009. While DK isn’t yet as super easy to grok as some of the other ChuckNorrisFramework tools and offers little in the idea of conventions, it is still a stellar framework to use for deployments. DK works well in environments where you know all of the environments you will deploy to ahead of time (although not required due to the ability ...
Today's 50% off Deal of the Day from O'Reilly is Developer's Guide to Collections in Microsoft® .NET "Put .NET collections to work—and manage issues with GUI data binding, threading, data querying, and storage. Led by a data collection expert, you'll gain task-oriented guidance, exercises, and extensive code samples to tackle common problems and improve application performance. This one-stop reference is designed for experienced Microsoft Visual Basic® and C# developers—whether you’re already using ...
Today's $10 Deal of the day book from APress at http://www.apress.com/97814... is Introducing .NET 4.0 With Visual Studio 2010 "You may know what's happening in C#, but what about the Azure cloud? How is that going to affect your work? What are the limitations of the pLINQ syntax? Introducing .NET 4.0: with Visual Studio 2010 guides you through the innovations that matter and helps you to seize new opportunities confidently and quickly. " ...
In this Issue: Michael Crump, Kevin Dockx, Ollie Riches, Shawn Wildermuth, Kunal Chowdhury, Beth Massi, Joost van Shaik, Colin Eberhardt, Tony Champion, David Catuhe, Igor, Jeremy Likness, and Dhananjay Kumar. Above the Fold: Silverlight: "SL5 PivotViewer Custom DetailPaneStyle" Tony Champion WP7: "Taking screenshots with Windows Phone 7 applications using a video feed" Joost van Schaik LightSwitch: "“I Command You!” - LightSwitch Screen Commands Tips & Tricks" Beth Massi Metro/WinRT/Windows8: ...
Below you will find my entire collection of Windows 8 Development Articles. I will focusing on XAML / C# Metro Applications in Windows 8, but may occasionally post on HTML / JS. Please bookmark this page as I plan on keeping this page updated with my latest Windows 8 articles. Windows RT XAML/C# Metro Applications Enabling Frame Rate Counters for XAML Applications in Windows 8 *NEW* - Adding an Application Bar to your XAML Metro Applications. Windows RT HTML/JS Metro Applications Enabling Frame Rate ...
ASP.NET view state, in a nutshell, is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks. View state has caused the most confusion among ASP.NET developers. When creating custom server controls or doing more advanced page techniques, not having a solid grasp of what view state is and how it works can come back to bite you. Web designers who are focused on creating low-bandwidth, streamlined pages oftentimes find themselves frustrated with view ...
Motivation Often you want to have the possibility to call a special abstract or virtual Initialize-method in a constructor of a base class to set individual initializing things in an override of this Initialize-method in a derived class. This is similar to the GOF-Pattern “Template Method”. But with C# this ends up with a warning “Virtual member call in constructor”. Why we get this warning? To show the effect of this approach, lets have a look at the source and the calling graph during runtime: ...
Introduction I recently found out that I have been awarded with the Q3 Community Champion Award from INETA. It is a honor and a privilege to be part of this Elite group of community leaders. I cannot tell you how excited that I am to be acknowledged by my peers for the community work that I do. Below is what the email said: I would like to congratulate you on winning the INETA Champion Award for the third quarter of 2011. I want to personally thank you for your time and effort in supporting and helping ...
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; ...
I recently began feeling like it was time for a change. I have been programming in C# for about a year and so I felt the urge to learn something new. So I went to the library and checked out a book on Ruby programming. I chose Programming Ruby 1.9 written by Dave Thomas and part of The Pragmatic Programmers series. I figured I might as well document my journey into the new world of Ruby on my blog. I’ve gotten through about six chapters and I really like what I see from Ruby. It’s really fun to learn ...
In the last few weeks I have had the pleasure of familiarising myself with various async patterns in C#. After going through the different approaches one gets a feel for how far we have come since the .Net 1 days. One particular pattern that I was not familiar with implementing but which has been available since the beginning of .Net is what I call the Async Begin / End Pattern. Since my interest is really making calls asynchronously so that I don’t block the UI thread - from what I can tell this ...
Introduction We are all familiar with the Application Bars in Windows Phone 7… It can be achieved with a few lines of code as shown below: <phone:PhoneApplicationP... <shell:ApplicationBar> <shell:ApplicationBarIco... IconUri="/icons/download.png" IsEnabled="True" /> <shell:ApplicationBarIco... IconUri="/icons/settings.png" IsEnabled="True" /> <shell:ApplicationBar.Me... <shell:ApplicationBarMen... x:Name="mnuReturnToHome" Text="return ...
Hello Everyone, I thought I’d take a minute to update everyone on my upcoming talks and events that I will be attending. I have talks ranging from Kinect, Silverlight, HTML5 to OData! Wow, that’s a wide range of technology and I’m very passionate about everyone of them. Let’s get started. DevReach - October 17th through the 18th in Sofia, Bulgaria. I will not be speaking at this event only attending. I am very excited because this will be my first time visiting Bulgaria. I am looking forward to meeting ...
OOook, those who know me, or have read my blog probably have a pretty good idea that I’m a silverlight, wpf, wcf, c#, xamly kinda guy. I’ve never really done anything webby, the closest I’ve gotten is doing a bit of backend stuff, well, times change, and quite frankly I wanted to do something new… soooo I’ve opted to go down the MVC route, for two main reasons – 1, I figured I may as well learn a good framework, 2, Matt Abbott told me that MVC lets you get dirty with HTML, and that’s one of the things ...
Test Data Builder Pattern When unit testing we often need to fill any POCO objects with enough data to satisfy the needs of the test. Redoing this in every test can quickly become a burden and slow down the testing process. Test Data Builder is a pattern that’s meant to help in just that situation. With test data builder you build a fluent interface that allows you to build out your POCO objects by only replacing the properties that you need specific values for. The other values are set to defaults ...
A reader of this blog wrote "It would be great to find out the reasons why programming languages are designed the way they are." The first computer languages were the assemblers. When I started programming in 1979, I learnt to read IBM360 machine code as well as write RPG, Cobol and CICS. Assembly languages are easier to use than writing directly in machine code. RPG stands for Report Program Generator and is an excellent language for writing reports to print on fixed pitch font printers. These were ...
Unlike the release of VB.NET with .NET 4.0, the next release of VB.NET doesn’t have the anything like as many new features, which is almost certainly because the language is really maturing and a lot more parity has been achieved between C# and VB.NET. Async The big new feature for both languages is the introduction of the await/async keywords. I won’t go into detail here because they are covered in lots of other places (including the VB.NET team blog). Yield One if the freebees we get because of ...
I was informed that my presentation on “Getting Started with the Kinect SDK” is now live on UserGroup.tv. The video quality is not that great, but that is my fault. Our camera quit working and someone had to record the session with an iPad2. Abstract: This talk is also designed for people who want to get started developing with the official Microsoft Kinect SDK. I will walk the user through downloading the bits and starting a new project. We will take a look at several great free open-source tools ...
Un servicio de hospedaje en Windows Azure, consiste en una aplicación diseñada para correr en la Nube de Microsoft y unos ficheros XML de configuración que definen cómo debe funcionar.El modelo del servicio es determinado por la configuración almacenada en los ficheros ServiceDefinition.csdef y ServiceConfiguration.csfg y que son utilizados por Windows Azure para saber como la aplicación ha de funcionar. Y los cuales hemos visto en las entradas sobre Gestión de Servicios Azure. ¿Qué es un Rol?Para ...
I was very optimistic when I first saw Metro style apps coded in C# on Windows 8, because for the most part they are not much different than the well known XAML/C# pair on Silverlight or WPF. This led me to brag a bit about probably having a port of MVVM Light ready “in a few days”. Of course I didn’t take in account that I would have a great time the week after //build in Seattle, with fantastic weather and tons of friends to have dinner and conversations with. Needless to say, the few days turned ...
In this Issue: AfricanGeek, Andrea Boschin, Colin Eberhardt, Anoop Madhusudanan, Lee, Laurent Bugnion, Rudi Grobler, Xianzhong Zhu, Jesse Liberty, Asim Sajjad, Dhananjay Kumar, XAMLNinja, and Kunal Chowdhury. Above the Fold: Silverlight: "Develop a Flexible 2.5D Scene Editor Targeting Silverlight RPG Games - Part 2" Xianzhong Zhu WP7: "A Windows Phone 7.1 (Mango) MVVM Tombstoning Example" Colin Eberhardt Metro/WinRT/Windows 8: "Consuming WCF Service in Windows 8 XAML/C# metro application" AfricanGeek ...
I have recently completed reviewing the APress book "Beginning C# Object-Oriented Programming" - ISBN13: 978-1-4302-3530-9. This is a good book to learn C# by doing something practical. I would give this book an unqualified excellent rating except there was some out of date advice on Exception handling with respect to the use of ApplicationException. (The advice given with Framework 2.0 has been superceeded. - see http://msdn.microsoft.com/e... where it states ...
First a big congratulations to all the new and renewed MVPs (October 1)! In this Issue: Rogier van der Hee, Laurent Bugnion, Andrej Tozon, András Velvárt, Rudi Grobler, Xianzhong Zhu, Derik Whittaker, Sumit Dutta, Asim Sajjad, Dhananjay Kumar, Charles Petzold, Nikola, XAMLNinja, and Ollie Riches. Above the Fold: Silverlight: "Connecting to FTDI devices using Silverlight 5 RC" Rogier van der Hee WP7: "Removing poly line from Bing Maps on WP7" Ollie Riches Metro/WinRT/Win8: "Metro Controls – Jump Viewer" ...
In this Issue: Colin Eberhardt, Dennis Doomen, Lazar Nikolov, András Velvárt, Rudi Grobler, Jeremy Likness, Derik Whittaker, Morten Nielsen, Sumit Dutta, Asim Sajjad, Ollie Riches, Kunal Chowdhury, and Beth Massi. Above the Fold: Silverlight: "Simulating rain in Silverlight Part 3 - Adding wind effect" Lazar Nikolov WP7: "Developing Windows Phone 7 HTML5 apps with PhoneGap" Colin Eberhardt LightSwitch: "LightSwitch Community & Content Rollup–September" Beth Massi Metro: "Lighting up your C# Metro ...
Introduction Just the other day I blogged about “Enabling Frame Rate Counter for XAML Applications in Windows 8”. At the very end of that post, I reminded everyone that that method does not work for HTML / JS Metro Applications. But, we are in luck as Mathias Jourdain provided sample code for accomplishing this in HTML / JS in his Build talk. The only problem was that he didn’t describe how to hook this into a new application to actually use. That is going to be the focus of today’s blog post. Let’s ...
The recently ratified C++11 language specification provides a range of cool new features. Many of which have been part of other programming languages for some time now. One such new feature that I value a lot is the concept of lambdas. Lambdas are great in many ways. They enable you to create callbacks that are called for specific items, for instance, or you can implement events with them, as is the case in this blog post. The following is an example of an event implemented in C++11 using lambdas. ...
In this Issue: Pete Brown, Derik Whittaker, Morten Nielsen, Sumit Dutta, Asim Sajjad, Ollie Riches, Kunal Chowdhury, Alexandra Rusina, Mohamed Mosallem, and Stephen Forte. Above the Fold: Silverlight: "pInvoke in Silverlight5 and .NET Framework" Alexandra Rusina WP7: "Geo-location on WP7 - don't trust the first value returned" Ollie Riches Metro: "Day 2: Building a Metro App with Visual Studio 11 Express" Stephen Forte Shoutouts: Michael Palermo's latest Desert Mountain Developers is up Michael Washington's ...
Well, as mentioned in my earlier posts, the ASP.NET MVC 4 has Developer Preview has been released. You might notice quite a bit of this term “Developer Preview” in 2-3 products specifically. One, Windows 8 is now available as simply Windows Developer Preview. Similarly, Visual Studio 11 is Developer Preview and also the Internet Explorer Platform Preview 3 is a Developer Preview, as with the case with Expression etc., Now, to clarify on a few things which I learnt. The Windows 8, hereinafter referred ...
In this Issue: Nguyen Pham, Nigel Sampson, Jesse Liberty, Derik Whittaker, Morten Nielsen, Sumit Dutta, Asim Sajjad, Peter Kuhn, Kunal Chowdhury, Beth Massi, Joost van Shaik, and Andrea Boschin. Above the Fold: Silverlight: "Setting SelectedValue for ComboBox" Asim Sajjad WP7: "Mango ‘Augmented Reality’ 101: showing a video background" Joost van Shaik Windows8: "Lighting up your C# Metro apps by Enabling Search–Part 1" Derik Whittaker LightSwitch: "Fun with the Office Integration Pack Extension for ...
In this Issue: Peter Kuhn, Scott Hanselman, David Anson, Kunal Chowdhury, Beth Massi, Rajat Jaiswal, MIke Ormond, WindowsPhoneGeek, Xianzhong Zhu, Jesse Liberty, Derik Whittaker, Morten Nielsen, Sumit Dutta, Asim Sajjad, and Dhananjay Kumar. Above the Fold: Silverlight: "How To Use DataTriggers In Silverlight DataGrid" Dhananjay Kumar WP7: "Windows Phone eBook 1st Edition Published" MIke Ormond LightSwitch: "Filtering Lookup Lists with Large Amounts of Data on Data Entry Screens" Beth Massi Windows ...
I had written earlier about the WebMatrix v2 Beta release that happened recently at the BUILD Conference As I had mentioned earlier, WebMatrix is a light weight tool for Web Development, Profiling, Database management, Optimization and also deployment. Its an end to end tool for web developers. Web Matrix is different from Visual Studio in the sense, it doesn’t require web developers to master C#, ASP.NET and other programming techniques. Web Matrix uses a simple Razor syntax and HTML markup for ...
I have a single page(created before Master pages were available) that loaded dynamically one or another user control.Some child controls have css for quirk mode, but for new controls I want to use latest DocType <!DOCTYPE html> The solution is to set it dynamically in code-behind depending on current control to load(the code is copied from http://stackoverflow.com/qu... =========aspx=============== <%@ Page Language="C#" ...

This is a quick tip, because it confused me at first. But thanks to the always excellent Tim Heuer and Peter Provost (from the Visual Studio team), here is the answer:

Usual disclaimer: This is for XAML/C#. I am not sure how this works for the other programming stacks.

Read the rest of this entry »