March 2011 - Posts
One of the great features of Visual Studio, that’s been around for a while is snippets. Frankly, I should build more of these because I use them *so* often. I find them so useful I thought I’d share them here, either for you to use or to template into ones of your own. Firs t,when building templated controls I write this a lot: [TemplatePart(Name = ElementContent, Type = typeof (FrameworkElement))] And it’s not just that, I then have to create a constant to define “ElementContent” and then usually load that value into a member variable as part of OnApplyTemplate. So I built a snippet that builds this stuff out for me, resulting in this: [TemplatePart(Name = ElementContent, Type = typeof (FrameworkElement))] //private...
If you look at a typical request for a page, the route will resolve the URL to the Display method of the ItemController in Orchard.Core/Routable/Controllers. That action will retrieve the content item for that route from the content manager and ask it to build the display. The ShapeResult it will produce is what is returned by the action. Let's pause for a second here and mention that we'll get back in a moment to what really happened during that BuildDisplay call. Now starts a second phase where that result gets executed and the shape tree starts getting rendered. One very important shape already exists at this point on the work context, and that is the Layout shape. When the time comes to render the Layout shape, Orchard will look...
A task that is likely to pop-up oftentimes when customizing an Orchard theme for a project is list rendering. Two types of shapes will typically be at work when rendering a list in Orchard: the summary shape and the list shape. The list shape itself will rarely vary as the semantics of a list pretty much mandate the use of a simple UL/LI decorated with CSS classes. It's so simple in fact that it's not even rendered by a template but by a C# shape method in CoreShapes.cs. The summary shapes can be rendered by templates that are specialized by content type and by display type. That covers most cases of list customization. In a few rare cases though, you'll want to simply take over the rendering of a specific list completely. In my...
In my LIDNUG demo last week, I showed an interesting technique that I know some people will want to apply to their own stuff. The scenario is that you want the main content being displayed on the page to render parts of itself outside of the Content zone, typically in a sidebar zone. My own example was a Buy From Amazon part that displays a badge in the sidebar to enable readers to buy the book being reviewed: Usually, zones contain widgets, but zones are just shapes, and they can contain any nested shape, not just widgets. Here is the shape we are building from our driver: var shape = shapeHelper.Parts_BuyFromAmazon( ProductSku: part.ProductSku, AssociateAccount: accountSettings.AssociateAccount, BackgroundColor: accountSettings.BackgroundColor...
In previous posts, we've seen two ways one can drive a small LED matrix from a Netduino . The first time , we just turned the rows and columns of the matrix on and off using digital ports on the Netduino. With this method, we have great control for sure, but it's no good for the following reasons. It's very slow: the digital ports on the microcontroller don't switch very fast. What kills it though is that we don't have enough digital ports on the Netduino: for an 8x8 matrix, you would need 16 ports and we only have 14. not to mention the final system we're building will need some ports for other things than display. With the second and third posts, we used a shift register. The way you talk to a shift register is that...
Do you see that Razor colorization, intellisense has stopped working after you have installed Visual Studio Sp1 RTM? The reason is that you might have MVC3 RC installed on the box which is not compatible with Visual Studio 2010 Sp1 RTM. To fix, you would need to install MVC3 RTM. Following are the details of the issue. What’s the issue? Razor intellisense/colorization stops working after installing Visual Studio 2010 RTM You might have MVC 3 RC with VS 2010 RTM that’s causing it. How do I check which version of MVC3 do I have? Simple way to check is to verify that the version of ProgramFiles\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll is 3.0.20105.0 If it’s not then most likely you have an older MVC3 build...
I just finished speaking at LIDNUG . You can download the recording here: http://www.lidnug.org/archives.aspx I hope I can make that available for streaming somewhere in the near future or maybe even reformat the content into shorter screencasts but this will do for now. I had prepared a metric ton of contents for the presentation and of course I wasn't able to show everything. I'm glad that I went to bed when I did yesterday instead of adding more stuff… The end result of what I had prepared can be downloaded from my DropBox (under BSD like everything Orchard): http://dl.dropbox.com/u/10032513/Lidnug.zip This contains the site that I showed plus the few things I didn't have time to show. Please don't use this for anything as...
Last week the data team shipped the Release Candidate of Entity Framework 4.1. You can learn more about it and download it here . EF 4.1 includes the new “EF Code First” option that I’ve blogged about several times in the past. EF Code First provides a really elegant and clean way to work with data, and enables you to do so without requiring a designer or XML mapping file. Below are links to some tutorials I’ve written in the past about it: Code First Development with Entity Framework 4.x EF Code First: Custom Database Schema Mapping Using EF Code First with an Existing Database The above tutorials were written against the CTP4 release of EF Code First (and so some APIs might be a little different) – but the concepts and scenarios...
Earlier this week I wrote a post detailing the application framework that I’ve been working on, which I’m calling AgFx. I wanted that post to be a bit of an introductory overview,. Now I’m going to dig into detail a bit more, as well as show a bit about how you can use the free Windows Phone 7 Developer tools to quickly create a great application. AgFx does a lot, and one of the apps I used to generate requirements and testing, is Jeff Wilcox’s gorgeous new foursquare™ client: 4th & Mayor , which is built on AgFx. Jeff and I, along with some others, have written several apps on top of AgFx over the last few months, and have really sharpened it to be exactly what you need when building a connected phone application...
Last week we shipped Service Pack 1 of Visual Studio 2010 and the Visual Studio Express Tools. In addition to bug fixes and performance improvements, SP1 includes a number of feature enhancements. This includes improved local help support , IntelliTrace support for 64-bit applications and SharePoint, built-in Silverlight 4 Tooling support in the box, unit testing support when targeting .NET 3.5, a new performance wizard for Silverlight, IIS Express and SQL CE Tooling support for web projects, HTML5 Intellisense for ASP.NET, and more. TFS 2010 SP1 was also released last week, together with a new TFS Project Server Integration Pack and Load Test Feature Pack. Brian Harry has a good blog post about the TFS updates here Read...
More Posts
Next page »