Tiago Salgado

.NET / SQL Server / IT / etc...


News

My Stats

  • Posts - 37
  • Comments - 26
  • Trackbacks - 0

Twitter












Recent Comments


Recent Posts


Archives


 

Project Silk provides guidance for building cross-browser web applications with a focus on client-side interactivity. These applications take advantage of the latest web standards like HTML5, CSS3 and ECMAScript 5 along with modern web technologies such as jQuery, Internet Explorer 9, and ASP.NET MVC3.

To illustrate this guidance, the project includes a reference implementation called Mileage Stats that enables its users to track various metrics about their vehicles and fill-ups. Much of the effort in building Mileage Stats was applied to the usability and interactivity of the experience. Animations were included to enhance the enjoyment of the site and AJAX is used to keep the interface responsive and immersive. A great deal of care was also taken to ensure the client-side JavaScript facilitates modularity and maintainability. To accomplish these design goals, the JavaScript code was structured into “widgets” that benefit from the jQuery UI Widget Factory.

More information at http://silk.codeplex.com/


 

Telerik has released two new tools, still in beta, for download, JustTrace and JustDecompile.

JustTrace

  • Profiler Types
  • Live Data
  • Attach to Running Process
  • Visual Studio Integration
  • Profiling Child Processes
  • Profiling Performance
  • RadControls in Action

JustDecompile

  • Fast Code Navigation
  • Side-by-Side Assemblies
  • Easy Assembly Management
  • Rich, WPF UI
  • Universal Find Usages
  • Decompiled Code Quality

Download JustTrace and JustDecompile Betas
JustTrace Official Feedback Forum
JustDecompile Official Feedback Forum


 

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource.

Example of web.sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
     <siteMapNode  url="~/" title="Home"  description="Home">
         <siteMapNode url="" description="Menu 1" title="Menu 1">
             <siteMapNode url="" description="SubMenu 1" title="Sub Menu 1"/>
         </siteMapNode>
         <siteMapNode url="" description="Menu 2" title="Menu 2"/>
         <siteMapNode url="" description="Menu 3" title="Menu 3"/>
     </siteMapNode> </siteMap>

Sample code to add to the page menu:

<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu"
      EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal"
      DataSourceID="SiteMapDataSource1"> </asp:Menu> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"  ShowStartingNode="false" />

Running the application, we will have something like the next picture:

To show or hide the menu depending on the type of access each user, we may define the Roles in each SiteMapNode.

Another way to control the menus visible, is to add an attribute in each SiteMapNode and depending on its value, or will not display each menu.

For this, the web.sitemap will be something like:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
     <siteMapNode  url="~/" title="Home"  description="Home" visible="true">
         <siteMapNode url="" description="Menu 1" title="Menu 1" visible="true">
             <siteMapNode url="" description="SubMenu 1" title="Sub Menu 1" visible="true"/>
         </siteMapNode>
         <siteMapNode url="" description="Menu 2" title="Menu 2" visible="true"/>
         <siteMapNode url="" description="Menu 3" title="Menu 3" visible="true"/>
     </siteMapNode> </siteMap>

The attribute "visible" is that we will indicate whether or not the menu is shown, and we'll add the event MenuItemDataBound on Menu with the following code:

protected void NavigationMenu_MenuItemDataBound(object sender, MenuEventArgs e)
{     SiteMapNode node = e.Item.DataItem as SiteMapNode;
     if (!string.IsNullOrEmpty(node["visible"]))
     {
         bool isVisible;
         if (bool.TryParse(node["visible"], out isVisible))
         {
             if (!isVisible)
             {
                 if (e.Item.Parent != null)
                     e.Item.Parent.ChildItems.Remove(e.Item);
                 else
                     ((Menu)sender).Items.Remove(e.Item);
             }
         }
     } }

Thus, we have our menu to show all nodes whose attribute value equals True.

To be able to directly control the menus that will be visible or not, I used a Treeview to bind the web.sitemap file and set all items to show a checkbox, which will indicate the status of the Visible attribute.

<asp:TreeView runat="server" ID="tvMenus" AutoGenerateDataBindings="False" DataSourceID="XmlDsSiteMap"
     OnTreeNodeCheckChanged="tvMenus_TreeNodeCheckChanged" ShowCheckBoxes="All" ShowLines="True"
     OnTreeNodeDataBound="tvMenus_TreeNodeDataBound">
     <DataBindings>
         <asp:TreeNodeBinding DataMember="siteMapNode" SelectAction="None" ShowCheckBox="True"
             TextField="title" />
         <asp:TreeNodeBinding DataMember="siteMapNode" TextField="title" />
         <asp:TreeNodeBinding DataMember="siteMapNode" TextField="title" />
         <asp:TreeNodeBinding DataMember="siteMap" />
     </DataBindings> </asp:TreeView> <asp:XmlDataSource ID="XmlDsSiteMap" runat="server" DataFile="~/Web.sitemap" XPath="/*/*/*"> </asp:XmlDataSource>

 

protected void tvMenus_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{     XmlElement node = e.Node.DataItem as XmlElement;
     if (node.Attributes["visible"] != null)
     {         if (!string.IsNullOrEmpty(node.Attributes["visible"].Value))
         {
             bool isVisible;
             if (bool.TryParse(node.Attributes["visible"].Value, out isVisible))
             {
                 e.Node.Checked = isVisible;
             }
             else
                 e.Node.Checked = true;
         }
         else
             e.Node.Checked = true;
     } }

Finally, to record the attribute changes depending on the state of the checkbox, we added to the Treeview TreeNodeCheckChanged event the following code:

protected void tvMenus_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
{     XmlDsSiteMap.GetXmlDocument().SelectSingleNode(e.Node.DataPath)
.Attributes["visible"].Value = e.Node.Checked.ToString(); }

And we add the button to save the changes the following code:

protected void btn_Click(object sender, EventArgs e)
{     XmlDsSiteMap.Save();
}

Now just enable and disable these items like we want to.


 

Great video by Brandon Foy


 

On Day 2 of Mix 2011, it announced the new version of Silverlight.

The main features in this first beta version are:

  • XAML Debugging with breakpoints for binding debugging
  • Implicit data templates for easy UI reuse
  • Double (and multi) click support
  • GPU-accelerated XNA-compatible 3D and immediate-mode 2D API
  • Low-latency sound effects and WAV support
  • Real operating system windows and multi-display support
  • Significant performance improvements, fixes and much more

You can see all necessary information and download links in http://www.silverlight.net/getstarted/silverlight-5-beta/


 

Client + cloud computing is a disruptive, new computing platform, combining diverse client devices – PCs, smartphones, sensors, and single-function and embedded devices – with the unlimited, on-demand computation and data storage offered by cloud computing services such as Amazon’s AWS or Microsoft’s Windows Azure. As with every advance in computing, programming is a fundamental challenge as client + cloud computing combines many difficult aspects of software development.

Orleans is a software framework for building client + cloud applications. Orleans encourages use of simple concurrency patterns that are easy to understand and implement correctly, building on an actor-like model with declarative specification of persistence, replication, and consistency and using lightweight transactions to support the development of reliable and scalable client + cloud software.

Orleans on Microsoft Research

Source:http://blog.agafonov.net.ua/post/2011/04/12/Orleans-software-framework-for-cloud-applications.aspx


 

ROOTS is a forum for presentation, debate and study of current trends within information technology, agile methods and software design. ROOTS is aimed at software developers, project managers, testers, designers, architects and usability professionals. The conference is organized over three days with keynotes, lectures, workshops and lightning talks of exceptional quality. Our tracks will typically focus on craftsmanship, methods and quality.

More information: http://rootsconf.no/


 

How to: Build a Windows Azure Application

How to: Use the Windows Azure SDK Tools to Package and Deploy an Application

How to: Configure a Web Application

How to: Manage Windows Azure VM Roles

How to: Administering Windows Azure Hosted Services

How to: Deploy a Windows Azure Application

How to: Upgrade a Service

How to: Manage Upgrades to the Windows Azure Guest OS

How to: Manage Management Certificates

How to: Manage Service Certificates

How to: Use Storage Services

How to: Configure Windows Azure Connect

How to: Manage CDN on Windows Azure

 

from: http://msdn.microsoft.com/en-us/library/gg432998.aspx (via http://blogs.msdn.com/b/otavio/)


 

Gantter, is a web-based project management tool and completely free.

It have Google Docs integration, allows you to import MPP files, and its available on 11 languages.

You can see all those features here.

URL: http://gantter.com/


 

It is available the April 2011 edition of MSDN Magazine

You can access to online contents following the link: http://msdn.microsoft.com/en-gb/magazine/gg749836.aspx


 

This documentation and accompanying sample application will get you started building a complete application for Windows Phone 7. You will learn about common developer issues in the context of a simple fuel-tracking application for your car named Fuel Tracker. This topic describes things you should know before you start creating your Windows Phone application.

Some of the tasks that you will learn include the following:

From http://msdn.microsoft.com/en-us/library/gg680270%28pandp.11%29.aspx