Microsoft All-In-One Code Framework

The Microsoft All-In-One Code Framework is a free, centralized code sample library provided by the Microsoft Community team. Our goal is to provide typical code samples for all Microsoft development technologies.
.
  • Microsoft All-In-One Code Framework

    Create a color picker for Windows Phone

    • 0 Comments

    One of the new features we plan to add to the next version of story creator is to add caption text support for each photo. This includes related settings such as text font and color. Adding font support isn't too difficult. But color is another story.

    It is easy enough to provide a static list to allow users select some pre-defined colors. But the experience may not be very good. Windows Phone supports 32 bit colors (2^32). Why limit the user experience to about 10 colors? This may be fine for certain scenarios, such as use a color to categorize a task. But for our application, a richer user experience is desired. So we decided to create a custom color picker that is similar to the one you find in  Expression Studio. In Expression Studio, you have a nice color picker. Below is  Expression Web's color picker (the software I use to write this blog post):

    What we want to create is a simplified version. It allows the user to use finger (or mouse in case of a mouse capable Windows 8 device) to pick a color,  but it doesn't show the detailed information such as HSB values. I first created a prototype before integrating it to the real application.

     

    In the above screenshot, the top control is a custom control, the color picker. The bottom color list is for comparison, to show what you will get if you simply want to allow users to select from a known color list.

    You can download the prototype from https://bluestar.blob.core.windows.net/prototypes/WPColorPicker.zip. Once  again, note this is a prototype, not a released sample.

    I think it will be fun to blog about the experience in developing this prototype. So here it goes. This article only talks about the Windows Phone version. We may talk about Windows 8 version in the future.

    The second part of this article is about HLS color model. This is what I learned by creating the prototype, and perhaps not too many of you are familiar with it. But the first  part of this blog post is about how to create UserControl  and custom control for Windows Phone. This information may be redundant with a  lot of existing information on the web. If you haven't created UserControl  and custom control, you may find it useful. If you're already familiar, simply skip the next section.

    UserControl and Custom Control

    Many people who have worked with Windows Mobile like to create system components. But this is not supported in Windows Phone. Only Microsoft and device OEMs are allowed to create system components. Fortunately, today in order to create reusable components, you do not actually need to make them system components. You can create web services (recommended to use REST as it is  supported on almost all devices), class libraries, control libraries (actually also class library), and so on. In this article, we will compare UserControl and custom control.

    From functionality point of view, UserControl is usually used within a  particular application. You use UserControl to divide a large page into several small pieces. Together they compose the application. UserControl can also be reusable. But that's not the main functionality of UserControl.

    Custom control, on the other hand, are created to be reused. In fact, all  system provided controls, except for UserControl, are custom controls. When you  create your own custom control, it behaves just like a built-in control, such as Button. They can be reused by other applications, as long as they reference your assembly. Custom control also supports style and control template, so you can customize its appearance in your application if you like.

    From development point of view, creating a UserControl is very easy. I think most of you have already done that. Visual Studio provides an item template for  this task.

    After creating a UserControl with this item template, you will get a XAML file and a code behind file. Then you develop the UserControl in the same way as your main page. In our prototype, we have a UserControl named ColorListUserControl, in the WPColorPickerTest project. It provides a simple color list to pick a known color.

    Creating custom control is a bit more complex, and currently Visual Studio doesn't provide an item template. A custom control's rendering is controlled by its control template, and you can modify its style and control template so different instances of the same custom control may render differently. So custom control does not have a specific XAML file and code behind. It only has a class. Some controls (such as our color picker) may rely on certain UI elements in order to work properly. In this case, you can use GetTemplateChild method to obtain named elements in control template.

    To create a custom control, first you need a class. This class must inherited Control or a sub class of Control (except for UserControl). Then create a folder named "Themes" under the root folder of your project. Under the Themes folder,  create a file named "Generic.xaml". Note the names are important. You must use  "Themes" and "Generic.xaml". Generic.xaml does not contain code behind. Its root  element is a ResourceDictionary. Here you can define a default style (without a key), which can be applied to all instances of this control.

    <ResourceDictionary

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:WPColorPicker="clr-namespace:WPColorPicker">

        < Style TargetType="WPColorPicker:ColorPicker">

           <Style.Setters>

               <Setter Property="Template">

                   <Setter.Value>

                       <ControlTemplate TargetType="WPColorPicker:ColorPicker">

                       </ControlTemplate>

                   </Setter.Value>

               </Setter>

           </Style.Setters>

        < /Style>

    </ResourceDictionary>

    You can modify the style and template in whatever way you want. Just note  this is merely a default style. The developer that uses this control may provide his/her own style and template, which makes the control look completely different from what you may expect. This is the same as you can modify a Button,  to make it look like a gun whose grip rotates when the button is clicked.

    To use the default style, you need to set the DefaultStyleKey in your control class's constructor. To get named elements from the default template, you can use GetTemplateChild. Usually you do this inside the OnApplyTemplate method. Do not assume the element definitely exists, as the template can be changed. If an element is critical for your control but it does not exist, you may want to  throw an exception.

         public class ColorPicker : Control

           {

            private Rectangle _saturationRectangle;

            public ColorPicker()

            {

                this.DefaultStyleKey = typeof(ColorPicker);

            }

            public override void OnApplyTemplate()
            {
                base.OnApplyTemplate();
     
                this._saturationRectangle = this.GetTemplateChild("saturationRectangle") as Rectangle;
                if (this._saturationRectangle == null)
                {
                    throw new ArgumentNullException("saturationRectangle");
                } 
            }

           }

    Now you can add whatever code you like to implement the control. For example,  use code to add event handlers for certain UI elements (you cannot use XAML to add event handlers).

    In our prototype, the WPColorPicker is a class library which implements a custom control that looks similar to Expression Studio's color picker.

    To use UserControl and custom control in your main page, you need to define an xml namespace.

    xmlns:WPColorPicker="clr-namespace:WPColorPicker;assembly=WPColorPicker"

    Then to use it:

    <WPColorPicker:ColorPicker x:Name="colorPicker"/>

    RGB and HSB

    Now comes the fun part. To create the color picker, you need to know something about RGB and HSB. Actually before creating the color picker, I didn't even know the name of HSB. I just wonder how Expression Studio works. So I asked  around. I got the answer from some guys in Expression Blend team (Thanks!).  Essentially, the standard solution to build a color picker is based on the HSB color model (also called HSV). You can learn about HSB onWikipedia. Here I'll briefly describe this concept (maybe not very precisely).

    We all know RGB. You can actually position RGB colors on a cube, whose 8 vertexes represent black, red, magenta, blue, green, yellow, white, and aqua.  Rotate the cube for 45 degrees, and project it to the horizontal plane. The result is a hexagon. All colors in the RGB color space are projected onto the hexagon. We define a coordinate system, where the black vertex of the cube (center of the hexagon) is 0,0,0. Each color can thus be defined using a 3 dimensional vector in the cube (or 2 dimensional vector on the projected hexagon). You can refer to this Wikipedia image for more information. I'm not sure if license permits me to copy the image here.

    For a particular color, we define C (Chroma) as the proportion of the distance from the origin to the edge of the hexagon. That is, OP/OP' in the above Wikipedia image. It is also the difference between the largest and smallest values of R, G, and B. If you want a proof why the two definitions are identical, refer to the Wikipedia article.

    We define H (Hue) as the angle between the horizontal line and the line connecting the projected point and center point, ranging from 0 to 360 degrees.

    We define V (Value, also called Brightness and thus B) as the maximum value of R, G, and B. As you can see from the above Wikipedia image, the smaller the value is (and thus the RGB values), the blacker the color will be. When value is 0, the color will be completely black (as the vector is 0,0,0).

    Finally, we define S (Saturation) as C/V. The smaller the saturation, the whiter the color will be.

    You may have already heard of those concepts if you've played with old colour TVs when you were a child. Together, Hue, Saturation, and Brightness are called HSB. We can see in most cases HSB has a one to one relationship with RGB. But if S is 0, the color is always white (whatever H and B is). If B is 0, the color is always black (whatever S and B is). The corresponding color vector in this case is a vertical line which is perpendicular with the horizontal plane.

    If you know HSB value, you can also compute the corresponding RGB value. For example, since S=C/V, then C=V*S. After you know the chroma, you can continue to calculate RGB. You can find the detailed formula here and here.

    Implement the formula

    Before we create the actual control, we need to implement the above formula to convert between RGB and HSB. The first thing we did is to write a simple console application. At this stage, we simply focus on implementing the formula, without thinking too much of code optimization, such as validating parameters.

        class Program
        {
            static void Main(string[] args)
            {
                TestToRGB(new HSB() { H = 60, S = 1, B = 1 });
     
                // Desired if H is no longer 45 when converted back. S = 0 means the color is white independent from H.
                TestToRGB(new HSB() { H = 45, S = 0, B = 1 });
                TestToRGB(new HSB() { H = 81, S = 0.74, B = 0.57 });
                TestToRGB(new HSB() { H = 35, S = 0.36, B = 0.38 });
                TestToRGB(new HSB() { H = 183, S = 0.18, B = 0.81 });
                TestToRGB(new HSB() { H = 294, S = 0.64, B = 0.27 });
     
                // Desired if H is no longer 45 when converted back. B = 0 means the color is black independent from H.
                TestToRGB(new HSB() { H = 165, S = 1, B = 0 });
     
                TestToHSB(new RGB() { R = 1, G = 0.14, B = 1 });
                TestToHSB(new RGB() { R = 0.51, G = 0.35, B = 0.28 });
                TestToHSB(new RGB() { R = 0.54, G = 0.39, B = 0.76 });
                TestToHSB(new RGB() { R = 0, G = 0.25, B = 0.12 });
                TestToHSB(new RGB() { R = 1, G = 0.78, B = 0.24 });
                TestToHSB(new RGB() { R = 0.97, G = 0.45, B = 0.62 });
     
                Console.ReadKey();
            }
     
            private static void TestToRGB(HSB hsb)
            {
                Console.WriteLine("Converting:");
                Console.WriteLine("H: " + hsb.H);
                Console.WriteLine("S: " + hsb.S);
                Console.WriteLine("B: " + hsb.B);
                RGB rgb = ConvertToRGB(hsb);
                Console.WriteLine("Result:");
                Console.WriteLine("R: " + rgb.R);
                Console.WriteLine("G: " + rgb.G);
                Console.WriteLine("B: " + rgb.B);
                HSB hsb2 = ConvertToHSB(rgb);
                Console.WriteLine("Converting back:");
                Console.WriteLine("H: " + hsb2.H);
                Console.WriteLine("S: " + hsb2.S);
                Console.WriteLine("B: " + hsb2.B);
                Console.WriteLine("Done.\r\n");
            }
     
            private static void TestToHSB(RGB rgb)
            {
                Console.WriteLine("Converting:");
                Console.WriteLine("R: " + rgb.R);
                Console.WriteLine("G: " + rgb.G);
                Console.WriteLine("B: " + rgb.B);
                HSB hsb = ConvertToHSB(rgb);
                Console.WriteLine("Result:");
                Console.WriteLine("H: " + hsb.H);
                Console.WriteLine("S: " + hsb.S);
                Console.WriteLine("B: " + hsb.B);
                RGB rgb2 = ConvertToRGB(hsb);
                Console.WriteLine("Converting back:");
                Console.WriteLine("H: " + rgb2.R);
                Console.WriteLine("S: " + rgb2.G);
                Console.WriteLine("B: " + rgb2.B);
                Console.WriteLine("Done.\r\n");
            }
     
            private static RGB ConvertToRGB(HSB hsb)
            {
                double chroma = hsb.S * hsb.B;
                double hue2 = hsb.H / 60;
                double x = chroma * (1 - Math.Abs(hue2 % 2 - 1));
                double r1 = 0d;
                double g1 = 0d;
                double b1 = 0d;
                if (hue2 >= 0 && hue2 < 1)
                {
                    r1 = chroma;
                    g1 = x;
                }
                else if (hue2 >= 1 && hue2 < 2)
                {
                    r1 = x;
                    g1 = chroma;
                }
                else if (hue2 >= 2 && hue2 < 3)
                {
                    g1 = chroma;
                    b1 = x;
                }
                else if (hue2 >= 3 && hue2 < 4)
                {
                    g1 = x;
                    b1 = chroma;
                }
                else if (hue2 >= 4 && hue2 < 5)
                {
                    r1 = x;
                    b1 = chroma;
                }
                else if (hue2 >= 5 && hue2 <= 6)
                {
                    r1 = chroma;
                    b1 = x;
                }
                double m = hsb.B - chroma;
                return new RGB()
                {
                    R = r1 + m,
                    G = g1 + m,
                    B = b1 + m
                };
            }
     
            private static HSB ConvertToHSB(RGB rgb)
            {
                double r = rgb.R;
                double g = rgb.G;
                double b = rgb.B;
     
                double max = Max(r, g, b);
                double min = Min(r, g, b);
                double chroma = max - min;
                double hue2 = 0d;
                if (chroma != 0)
                {
                    if (max == r)
                    {
                        hue2 = (g - b) / chroma;
                    }
                    else if (max == g)
                    {
                        hue2 = (b - r) / chroma + 2;
                    }
                    else
                    {
                        hue2 = (r - g) / chroma + 4;
                    }
                }
                double hue = hue2 * 60;
                if (hue < 0)
                {
                    hue += 360;
                }
                double brightness = max;
                double saturation = 0;
                if (chroma != 0)
                {
                    saturation = chroma / brightness;
                }
                return new HSB()
                {
                    H = hue,
                    S = saturation,
                    B = brightness
                };
            }
     
            private static double Max(double d1, double d2, double d3)
            {
                if (d1 > d2)
                {
                    return Math.Max(d1, d3);
                }
                return Math.Max(d2, d3);
            }
     
            private static double Min(double d1, double d2, double d3)
            {
                if (d1 < d2)
                {
                    return Math.Min(d1, d3);
                }
                return Math.Min(d2, d3);
            }    
        }
     
        public struct RGB
        {
            public double R;
            public double G;
            public double B;
        }
     
        public struct HSB
        {
            public double H;
            public double S;
            public double B;
        }
    

    If you run the above code, you'll see as long as neither S nor B is 0, after HSB is converted to RGB and then converted back to HSB, the value doesn't change. But if either S or B is 0, the converted back value may be different.

    Implement the control

    Now we can port the console application's code to Windows Phone. Most of the code can be reused. Of course, in production environment, in addition to simply implementing the algorithm, you must optimize your code, such as validating all parameters, to make sure they're valid (for example, both S and B must stay between 0 and 1, and H must stay between 0 and 360).

    I've tried to do some code optimization in the prototype so I can integrate it into our real application more easily. But note the attachment of this article is still a prototype. If you want to use it in your application, please double check to make sure it doesn't have any bugs, security issues, and performance is optimized.

    The code of this custom control is quite long, so I won't paste it here. Below are several points of interest:

    Use design patterns

    We recommend you to use design patterns whenever it fits. For example, a  commonly used design pattern in Windows Phone is MVVM. In the prototype, the  ColorPickerViewModel class serves as a view model. It provides data for view, and encapsulates implementation logic, such as the above formula. The control class itself is ColorPicker, which acts as a view. Usually you don't put any  implementation logic in a view. But a view may contain presentation logic.

    One advantage of MVVM is when you change the presentation, you can be confident the implementation logic will remain intact. In addition, if you're not creating custom controls, very often the view also includes XAML. In XAML you can use data binding to bind certain properties on elements directly to properties in the view  model, and as long as you implement INotifyPropertiesChange, you don't need to write any code to modify the presentation when a property's value changes. You can learn more about MVVM here.

    Validate parameters and properties

    As pointed out above, in production code, it is very important to validate parameters and properties, as long as you don't control them. For example, hue must stay between 0 and 360:

            public double Hue
            {
                get { return this._hue; }
                set
                {
                    if (value < 0 || value > 360)
                    {
                        throw new ArgumentOutOfRangeException("value");
                    }
     
                    if (value != this._hue)
                    {
                        this._hue = value;
                        this.ConvertToRGB();
                        this.NotifyPropertyChanged("Hue");
                    }
                }
            }

    If you don't perform the validation, you may introduce bugs. There is an exception. If you're writing a private method, you don't have to validate the parameters, as you have full control over the method, and if the parameters come from public properties, you can perform validation on the properties.

    Similarly, you may need to check for overflow if certain calculation in your implementation may cause it.

    Use style instead of inline properties

    If you're an HTML developer, you probably know the best practice is to use CSS instead of inline properties. The same principle applies to XAML. In XAML, try to use style whenever possible, especially if the property only controls presentation. It may make sense to use inline properties for behavior properties, though, as it makes the logic clearer by reading XAML without looking into a separate style file.

    You can use Expression Blend to extract styles from a control that you've applied inline properties. Of course you can also create styles manually.

    Make interactable elements bigger

    Do not forget there's no mouse on Windows Phone. You can only use your finger. Even on Windows 8, it is highly recommended to design your UI for touch experience. This is commonly forgot (at least for me) when testing using the emulator, which supports mouse. Usually a finger is not so precise as a mouse.  So it is recommended to make all interactable elements bigger than you may expect. Compare our prototype with Expression Studio's color picker, you'll note our ellipse and thumb are bigger.

    Similarly, it is not easy to input text. So you should only require the user  to type text when it is definitely necessary. Thus we make the caption text  feature as optional. If the user doesn't want to give a caption to a photo, then fine. The emulator already does a good job to annoy you by not  supporting physical keyboard. Some of you may find it annoying, but remember this is the experience you get on a real phone. If you feel annoyed, same does the user if you require too much text input.

    More references

  • Microsoft All-In-One Code Framework

    The future of Story Creator

    • 0 Comments

    A while ago we released a sample called Story Creator: http://code.msdn.microsoft.com/CSWP7AzureVideoStory-2b9c3e12. It combines  several technologies, such as Windows Phone, Windows Azure, WCF, and C++. It is  a complete application that you can use and extend. But we're also aware of some limitations. For example, it is based on Windows Phone 7.0, not the latest Mango release. It doesn't offer too many features. However, do not worry. We don't stop here. We want to  continue to improve it, and provide more features.

    In this blog post, I'll outline several potential features that may come in a  future release. Note I'm not promising anything here. This is just what we're trying to do.

    The focuses on the next release are:

    • Upgrade to Windows Phone 7.1
    • Create a Windows 8 XAML version of the client application, using .NET (not C++)
    • Create a Windows 8 HTML version of the client application
    • Port the C++ native video encoding component (used in the worker role) to a custom WinRT component
    • Add some new features, such as caption text for each photo, and secondary tiles integration with Windows Phone/Windows 8
    • Fix bugs
    • Refactor code

    Starting from now, I'll try to write some blog posts about how we implement  those new features. As soon as a sample application gets a little bigger, it is difficult to see how it works without documentations. These blog posts reflect the work I'm doing. But they may not directly reflect what the final sample application will be. In addition, I'm also learning. There're a lot of new technologies, and I think I still have a lot to learn about programming best practices. So bare with me if you see something that may not be a best practice. I'll be very appreciated if you can point out problems in these blog posts.

    What's more, some of the blog posts may contain project attachments. These projects are NOT samples, but rather prototypes. Sometimes I'm unsure how to proceed to implement a certain feature, so I write prototypes before actually implementing it. The prototypes should in general work fine. But if you want to use them in your production code, you should check carefully to make sure they don't contain bugs, security issues, and performance is fine.

    Finally, I don't know how many blog posts I will be writing. After all, this  sample is a side project. Usually I can only spend my spare time on it.

    If you have any suggestions, feel free to leave comments on the blog posts.

  • Microsoft All-In-One Code Framework

    Microsoft All-In-One Code Framework 2012 January Sample Updates

    • 1 Comments

    A new release of Microsoft All-In-One Code Framework is available on Feb 6th.  We expect that its 8 new code samples covering typical programming scenarios in Windows Azure, Directory Services, Hyper-V, TFS, WDK, and Windows SDK would ease your development work.

    image

    You can download the code samples using Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

    If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

     

    --------------------------------------------

    New Windows Azure Code Samples

    image

    Configure SSL for specific page(s) while hosting the application in Windows Azure (CSAzureSSLForPage)

    Download: http://code.msdn.microsoft.com/CSAzureSSLForPage-e844c9fe

    The sample was written by Narahari Dogiparthi – Escalation Engineer from Microsoft.

    While hosting the applications in Windows Azure, developers are required to modify IIS settings to suit their application requirements. Many of these IIS settings can be modified only programmatically and developers are required to write code, startup tasks to achieve what they are looking for. One common thing customer does while hosting the applications on-premise is to mix the SSL content with non-SSL content. In Windows Azure, by default you can enable SSL for entire site. There is no provision to enable SSL only for few pages. Hence, Narahari has written sample that customers can use it without investing more time to achieve the task.

     

    Change AppPool identity programmaticall​y (CSAzureChangeA​ppPoolIdentity)

    Download: http://code.msdn.microsoft.com/CSAzureChangeAppPoolIdentit-27099828

    The sample was developed by Narahari Dogiparthi – Microsoft Escalation Engineer too.

    Most of customers test their applications to connect to cloud entities like storage, SQL Azure, AppFabric services via compute emulator environment. If the customer's machine is behind proxy that does not allow traffic from non-authenticated users, their connections fail. One of the workaround is to change the application identity. This cannot be done manually for Azure scenario since the app pool is created by Windows Azure when it is actually running the service. Hence, Narahari has written sample customers can use to change the AppPool identity programmatically.

     

    --------------------------------------------

    New Directory Services Code Samples

    image

    Write / add SPN to user or computer account in AD (CSDsWriteAccou​ntSPN)

    Download: http://code.msdn.microsoft.com/CSDsWriteAccountSPN-95c31397

    Developed by Shaleen Thapa – Microsoft Support Escalation Engineer, this sample application demonstrates how to write/add Service Principal Name (SPN) to any user or computer account object in Active Directory. This sample must be run on domain environment and under the Domain Admin privileges.  You can execute this sample by creating the exe via Visual Studio but it must be running under the domain admin credentials. Also this code must be running either on Domain controller or any one of the member servers.

     

    Get User Group Membership in AD (VBGetUserGroup​InAD)

    Download: http://code.msdn.microsoft.com/VBGetUserGroupInAD-a94dc080

    Developed by Shaleen Thapa – Microsoft Support Escalation Engineer, this sample application demonstrates how to perform a search on the user’s group membership in Active Directory. This demonstrates the recursive looping method. Also it shows how to get the Object SID for the group.

    We are using System.DirectoryServices namespace to perform a search on AD. We will be passing the distinguishedName of the domain with the username whose membership we would like to fetch.
     
    Once we found the user, we will read the memberOF attribute’s value. It is one of the possibilities that the group can be member of another group as well; in this case we would need to do a recursive looping.

     

    --------------------------------------------

    New Hyper-V Code Samples

    image

    Clone Hyper-V VM Settings (CSHyperVCloneV​M)

    Download: http://code.msdn.microsoft.com/CSHyperVCloneVM-81c4d648

    Developed by Jithesh Nair – Microsoft Support Escalation Engineer, this sample demonstrates how to create VM from an existing VM template without copying the VHD file.

    The existing methods of cloning VMs include exporting/importing the VM configuration along with VHD. If the VHD size is larger this method of cloning takes too much of times. There are scenarios where the customers wanted to creates VMs programmatically from an existing template. This sample demonstrates how one can use WMI and C# for cloning VMs without copying VHD.

     

    --------------------------------------------

    New TFS Code Samples

    image

    Add CheckOut Event to TFS (CSTFSAddCheckO​utEventType)

    Download: http://code.msdn.microsoft.com/CSTFSAddCheckOutEventType-673d0536

    Developed by Ruiz Yi – Sample Writer of Microsoft All-In-One Code Framework, the sample demonstrates how to enable checkout notification in TFS2010.  In TFS2010, when a user sends a Check out (PendChanges) request to server, the server will send a PendChangesNotification before the items are checked out. If we subscribe this notification, we can do following things:

    1. Deny the request.
    2. Fire the custom CheckOut event.  NOTE: As this notification is sent before the items are checked out, we can only know someone is trying to checkout some items.

     

    --------------------------------------------

    New WDK Code Samples

    Virtual Device Driver (WDKRamDisk)

    Download: http://code.msdn.microsoft.com/WDKRamDisk-c3322885

    Developed by Bart Bartel – Microsoft Senior Escalation Engineer, this is the Ramdisk sample driver.  This version of the driver has been modified to support the driver frameworks. This driver basically creates a nonpaged pool and exposes that as a storage media. User can find the device in the disk manager and format the media to use as FAT or NTFS volume. In addition, this version of Ramdisk integrates with Mount Manager, so that it is not necessary for you to assign a drive letter, the system will do this automatically.

     

    --------------------------------------------

    New Windows SDK Code Samples

    List process type information for all running processes (CppCheckProces​sType)

    Download: http://code.msdn.microsoft.com/CppCheckProcessType-1f81439d

    Developed by Amit Dey – Microsoft Software Development Engineer, this sample code lists process type information for all running processes. like:

    • Is a Console Application or Is a Windows Application
    • Is a Managed Application or Is a Native Application
    • Is a .NET 4.0 Application
    • Is a WPF Application
    • Is a 64 Bit Application or Is a 32 Bit Application

    image

     

    If you have any feedback, please fill out this quick survey or email us: onecode@microsoft.com

  • Microsoft All-In-One Code Framework

    Happy New Year from Microsoft All-In-One Code Framework

    • 0 Comments

    What a year!  So many exciting things have happened since last year. We have been so blessed this year again with your love and support, the breakthrough of 3 million downloads, 700 code samples, over 90% customer satisfaction, the winning of Global 2011 Microsoft Next award, the release of Sample Browser and Sample Browser VS extension, and many other new experiences and achievements.  Our team received lots of constructive feedback and kudos from you throughout the year, and we take action quickly to improve things.  Thank you!

    We are looking forward to the New Year, and many coming new launches and growths.   For example, in early 2012, you can expect to see the birth of a new script library project targeting the ITPro audience.   Similar to Microsoft All-In-One Code Framework for developers, this new script library will be a centralized system administration script library driven by IT professionals’ real-world pains and needs observed in TechNet Forums, communities and IT support calls.   The goal is to provide customer-driven scripts for Microsoft products and reduce IT professionals’ efforts in solving typical system admins tasks in Windows Servers, SQL Servers, Exchanges, Office 365, SharePoint Servers, Windows Clients, and Office Clients.  We are just getting started and have several scripts in the pipeline; this will continue to grow.   Additionally, you can also expect to see the release of a new version of Sample Browser.   We expanded the Sample Browser to search for all samples in MSDN Samples Gallery.  With this new version, you will be able to search and download not only 700+ All-In-One Code Framework samples, but also thousands of other Microsoft and community samples.  With this effort, we hope to ease your effort in looking for and managing the wanted code samples.

    The holiday season is such a special time for us, a time of new beginnings. Also a time of saying many thanks to all of you. We sincerely wish you a very happy and blessed New Year!

    Blessing to all of you!

    - Microsoft All-In-One Code Framework Team

  • Microsoft All-In-One Code Framework

    Microsoft All-In-One Code Framework December Sample Updates

    • 0 Comments

    Wishing a very happy and blessed New Year to you in advance!

    A new release of Microsoft All-In-One Code Framework is available on December 29th.  We expect that its 11 new code samples covering typical programming scenarios in Windows Phone 7, ASP.NET, WPF, Windows Shell, and WDK would ease your development in the coming New Year.

    image

    You can download the code samples using Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

    If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

     

    --------------------------------------------

    New Windows Phone 7 Code Samples

    image

    Story Creator Sample Application for Windows Phone 7 (CSWP7AzureVideoStory)

    Download: http://code.msdn.microsoft.com/CSWP7AzureVideoStory-2b9c3e12

    Developed by Yi-Lun Luo – a sample writer of Microsoft All-In-One Code Framework, CSWP7AzureVideoStory is a big sample application combing many hot technologies such as Windows Phone 7, Windows Azure, HTML5. 

    This sample solution is a story creator for Windows Phone 7. You can use it to create photo stories on your phone, and send the stories to a Windows Azure service to encode them into videos. The Windows Azure Service includes a REST service built with WCF Web API, a simple HTML5 browser client that allows you to see encoded videos, and a native component encodes videos using WIC and Media Foundation.

    While individual pieces of technologies are very interesting, the true power comes when the platforms are combined. We know most developers need to work with the combined platform rather than individual technologies. So we hope this sample solution will be helpful to you.

    image image

    imageimage
     

     

    --------------------------------------------

    New ASP.NET Code Samples

    image

     

    Using Direct2D for Server-Side Rendering with ASP.NET (CSD2DServerSideRendering)

    Download: http://code.msdn.microsoft.com/CSD2DServerSideRendering-2d099ab6
    Developed by Greg Binkerd – Microsoft Senior Escalation Engineer

    Some server applications need to render images and send back the generated bitmaps to users connected through web clients.  For example, ASP.NET web applications that needs to generate user profile picture on the fly.  We observed that many developers choose to use GDI+ and System.Drawing to generate those images, but actually GDI+ and System.Drawing are not supported in a service or web application.  Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions  (see the “Caution” section in http://msdn.microsoft.com/en-us/library/system.drawing.aspx).

    Direct2D is the appropriate technology for rendering images to a bitmap on disk in a service context.  Direct2D is completely supported in the context of a service.  This is a C# ASP.NET sample which demonstrates how to render a Direct2D scene to an image file on disk.  It demonstrates how to create a Direct2D bitmap based on image data in memory, draw Direct2D objects, such as an Ellipse and a Rectangle, and it also demonstrates how to use DirectWrite to render text.  The sample uses the Direct2D and DirectWrite assemblies from the Windows API Code Pack for Microsoft .NET Framework.  These provide developers access to Direct2D and DirectWrite from managed code.

    image

    For more information on DirectWrite, see the MSDN DirectWrite documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/dd368038(v=vs.85).aspx 

    For more information on DirectWrite, see the MSDN DirectWrite documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/dd368038(v=vs.85).aspx 

    For more information on the Windows API Code Pack for Microsoft .NET Framework, see: http://archive.msdn.microsoft.com/WindowsAPICodePack

     

    Maintain ASP.NET TreeView State (CS/VBASPNETMainta​inTreeViewState​)

    Downloads
    C# version: http://code.msdn.microsoft.com/CSASPNETMaintainTreeViewSta-c7673683
    VB version:  http://code.msdn.microsoft.com/VBASPNETMaintainTreeViewSta-01591ffc
    Developed by Arwind Gao – Microsoft All-In-One Code Framework Sample Writer

    The code-sample illustrates how to maintain TreeView's state across postbacks.  The web application use session store the TreeView nodes' status and restore them in the next postback event. This interesting function can be used as the signs of the navigator bar.

    image

     

    Client templating with jQuery and JSON (CS/VBASPNETClient​TemplateJQueryJ​SON)

    Downloads
    C# version: http://code.msdn.microsoft.com/Client-templating-with-0c85db68
    VB version: http://code.msdn.microsoft.com/VBASPNETClientTemplateJQuer-fac556f6
    Developed by Arwind Gao – Microsoft All-In-One Code Framework Sample Writer

    This project illustrates how to display a tabular data to users based on some inputs in ASP.NET application. We will see how this can be addressed with JQuery and JSON to build a tabular data display in web page. Here we use JQuery plug-in JTemplate to make it easy.

    image

     

    --------------------------------------------

    New WPF Code Samples

    WPF ListBox Validation (CSWPFListBoxVa​lidation)

    Download: http://code.msdn.microsoft.com/CSWPFListBoxValidation-a3023d06
    Developed by Jon Burchel – Microsoft Senior Escalation Engineer

    The sample demonstrates how to add validation to a ListBox, overriding the control to contain a ValidationListener property, which can be bound to provide validation using built in validation UI features in WPF.

    To run the sample, simply open in Visual Studio 2010 and run it. It contains a ListBox, which was overridden to include a property called ValidationListener, which is used to bind the ListBox to a property used for validation, and a validation rule. The validation property is simply a text field added to the Window, in which error text is written if the ListBox is found having no selected items. Of course the rule could be more complex as necessary, but this demonstrates the approach. When the form first displays, no items are selected, so it is not valid. Validation UI displays a red outline around it, and another label control is also validated using the same criteria, and is outlined in red as well, and displays the validation error message. Selecting any items validates the control. Removing all selections will again invalidate the control.

    image

     

    Search and Highlight Keywords in TextBlock (CS/VBWPFSearchAndHighlightTextBlockControl)

    Downloads
    C# version: http://code.msdn.microsoft.com/CSWPFSearchAndHighlightText-3b5e207a
    VB version: http://code.msdn.microsoft.com/VBWPFSearchAndHighlightText-f9f2fe58
    Developed by Jason Wang – Microsoft All-In-One Code Framework Sample Developer

    The WPF code sample demonstrates how to search and highlight keywords in a TextBlock control.  The sample includes a custom user control "SearchableTextControl" and its search method is used to demonstrate how to highlight keywords using System.Windows.Documents.Run and System.Windows.Documents.Incline.

    image

     

    --------------------------------------------

    New Windows Shell Code Samples

    Print an image using ShellExecute (CSShellPrintIm​ageWithShellExe​cute)

    Download: http://code.msdn.microsoft.com/CSShellPrintImageWithShellE-adda9973
    Developed by Jon Burchel – Microsoft Senior Escalation Engineer

    The sample demonstrates how to print an image using ShellExecute to invoke ImageView_PrintTo, equivalent to right clicking on an image and printing. Using the printto verb with ShellExecute may have unpredictable effects since this may be configured differently on different operating systems.  The approach demonstrated here invokes ImageView directly with the correct parameters to directly print an image to the default printer.

    To run the sample, simply open in Visual Studio 2010 and run it. It simply prompts the user to select any image file, using the OpenFileDialog, and then uses ShellExecute to launch ImageView_PrintTo, exposed in shimgvw.dll, with rundll32.exe, and providing the necessary parameters to this function.  This is more reliable than trying to use the Shell printto verb, which may or may not be configured for a particular file type, and so may not work for images.

     

    --------------------------------------------

    New WDK Code Samples

    Enumerating and locating specific attach storage devices. (CppStorageEnum​)

    Download: http://code.msdn.microsoft.com/CppStorageEnum-90ad5fa9
    Developed by Bart Bartel – Microsoft Senior Escalation Engineer

    The code sample demonstrates the use of DeviceIoControl and SetupDiGetClassDevs in the everyday operations of enumerating and locating specific attach storage devices.  To run this sample, you need to install the Windows Driver Kit (WDK).  After building the sample successfully, just press Ctrl + F5 to run it. Then you may see something like this:

    image

     

    In closing, I want to take opportunity to wish you and your family my best wishes for this Holiday Season.  The Holiday season is always a special time when we can spend time with our family and friends.  I wish all of you the very best for the upcoming New Year!

    Thank YOU for your support of Microsoft All-In-One Code Framework!

  • Microsoft All-In-One Code Framework

    Microsoft All-In-One Code Framework November Sample Updates

    • 5 Comments

    A new release of Microsoft All-In-One Code Framework is available on November 1st.  We expect that its 11 new code samples covering Dynamics NAV, Silverlight, ASP.NET, WDK would ease your development work in these areas

    image

    You can download the code samples using Sample Browser or Sample Browser Visual Studio extension.  They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

    If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, and read the introduction on our homepage http://1code.codeplex.com/.

     

    ------------------------------------------

    New Dynamics NAV Code Samples

    In our Facebook page, and the feedback mailbox, we heard lots of customers’ voices for adding Dynamics code samples to Microsoft All-In-One Code Framework.  People hope to learn Dynamics development through real-world code samples.   Lars Lohndorf-Larsen and Jasminka Thunes – two Microsoft Escalation Engineers of Dynamics - championed for it.   Thanks to their driving and supports, we are officially kicking off Dynamics code samples now.  In this release, we have two new Dynamics code samples created by the two brilliant Escalation Engineers.

    Use PowerShell & other techs to manage NAV Services (CSDynamicsPowe​rShellAdmin)
    Download: http://code.msdn.microsoft.com/CSDynamicsPowerShellAdmin-3b682d97

    Created by Lars Lohndorf-Larsen – Microsoft Escalation Engineer of Dynamics, this code sample demonstrates how to uses PowerShell to list and manage NAV Services:

    • List NAV Services
    • Start and stop services
    • Enter the name of a remote computer to manager NAV Services on that computer

    The sample also uses xml to show and update CustomSettings.config.
     
    The purpose of this sample is to illustrate how to use PowerShell and other technologies for managing NAV Services. It is on purpose developed to be just about useful as it is, but with lots of scope for further development.

    The definition of a NAV Service for this purpose is a service where the name of the executable contains "Dynamics.Nav", and it is assumed that any such service is a Dynamics NAV2009 middle-tier Service for connections from either RoleTailored Client or NAV Web Services.

     

    How to boost performance on Dynamics NAV RTC reports
    Download: http://code.msdn.microsoft.com/How-to-boost-performance-ffb6c384

    Created by Jasminka Thunes – Microsoft Escalation Engineer of Dynamics, this sample is an example that illustrates how to boost performance on RTC reports. This applies to reports that are printing confined record sets (normally anything under several thousands). The attached object shows how to correctly structure the report, where possible, so as to avoid sending any records that will not show at the print/preview on RTC.

    In this example, report 1001 is modified so the dataitem used for calculation and print of footer values only (Value Entry) is removed. Footer is replaced with separate dataitem of type integer, and calculation of the values it will show is done in OnAfterGetRecord trigger of the parenting dataitem.

     

    ----------------------------------------

    New Silverlight Code Samples

    UDP multicast client in Silverlight (CSSL4UdpAnySourceMulticastListener)
    Download: http://code.msdn.microsoft.com/CSSL4UdpAnySourceMulticastL-3fb81c14

    Created by Jon Burchel – a senior support escalation engineer on the user interface team at Microsoft, this Silverlight code sample demonstrates the use of the UdpAnySourceMulticastClient, sharing messages between as many clients as may broadcast on the same port (8888 in this code sample).  Open multiple instances of the webpage from any machines on a network supporting multicast (or locally on a single machine) to try it out.  In order for multicast to work from Silverlight, there must exist a MulticastPolicyServer on the network.  Each message is identified by its client’s session ID associated with the web site from where the Silverlight application was loaded.  This sample exposes a simple console application, which runs when it is debugged, to expose such a server.  The code for this server is available as part of this Silverlight SDK, here included as a single binary referenced in the console application.

    image

     

    Session continuation from ASP.NET to Silverlight (VBSL4SessionCookie)
    Download: http://code.msdn.microsoft.com/VBSL4SessionCookie-2b8c02d2

    This is the VB.NET version of Jon Burchel’s “Session continuation from ASP.NET to Silverlight” code sample.  You can find its C# version here. This sample demonstrates a simple technique to preserve ASP.NET session ID from a web page hosting a Silverlight component making a client WebRequest to another web page on the same site.  Normally, the WebRequest will not by default preserve session id, and this can be frustrating for a Silverlight developer.  But by appending the Session ID cookie manually to the request, passing it into the Silverlight component through a parameter on the calling web page, the session can in fact be preserved.

    image

     

    Use Silverlight fragment navigation to perform a search (VBSL4FragmentSearch)
    Download: http://code.msdn.microsoft.com/VBSL4FragmentSearch-2e8b4c6d

    This is again the VB.NET version of Jon Burchel’s “Silverlight Fragment Search” sample. It has a very simple implementation demonstrating the use of fragment navigation within Silverlight to perform a search.  This allows users to save a URL and return immediately to their search location later using a link.  Of course, the fragment can be used in many other ways to track state, not simply to provide a search, but this shows the usefulness of the technique to preserve state within Silverlight using fragments.

    A sample music player supporting playlist in Silverlight (CSSL4MusicPlayer, VBSL4MusicPlayer)
    Downloads:
    C# version: http://code.msdn.microsoft.com/CSSL4MusicPlayer-069bbbf8
    VB version: http://code.msdn.microsoft.com/VBSL4MusicPlayer-06d1bbce

    Created by Arwind Gao – our sample developer, the project demonstrates how to create a music player supporting playlist in Silverlight. User can upload some music files in Web application and generate xml file, the xml file includes some useful information of music files.

    image

     

    -------------------------------------------------

    New WDK Code Samples

    Sample StorPort Virtual Miniport (WDKStorPortVir​tualMiniport)
    Download: http://code.msdn.microsoft.com/WDKStorPortVirtualMiniport-973650f6

    Created by James Antognini – Microsoft Senior Escalation Engineer of WDK, this code sample is a StorPort virtual miniport that presents the appearance of 1 or more Fibre Channel Host Bus Adapters (HBA). Under an HBA, the sample creates LUNs/disks, which can be formatted and used by a file system such as NTFS.

    A StorPort virtual miniport is much like a StorPort real miniport. A virtual miniport differs in several ways:

    1. The virtual miniport does not control hardware in a way supported by StorPort. It may conceivably control hardware by other means.
    2. Since there is no StorPort support for hardware control, the miniport does not use DMA or DMA operations (via StorPort APIs, that is). There is no Interrupt object or lock.
    3. The miniport can employ any API documented in the WDK for WDM drivers.

    A virtual miniport is like a real miniport in important ways:

    1. StorPort as port driver handles PnP and power operations.
    2. StorPort supports the handling of other I/Os with the miniport’s support (through callbacks). That handling makes it possible for miniport-provided LUNs to be handled much as any other disk might be handled, including having a drive letter, mounting a file system and doing open, read/write, close and other kinds of I/O.
    3. StorPort handles the details of I/O queuing when and as needed (e.g., queue depth, pausing, resuming).
    4. Along with ClassPnP, StorPort can retry I/Os.

    The sample assumes some familiarity with StorPort miniports. Sample documentation is minimal, consisting of this file and of comments in the sample’s buildable files. The WDK should be studied for more information about miniports.

     

    ----------------------------------------------

    New ASP.NET Code Samples

    ASP.NET load globalization resources from assembly
    Download:
    C# version: http://code.msdn.microsoft.com/CSASPNETGloablizationInAsse-61b88691
    VB version: http://code.msdn.microsoft.com/VBASPNETGlobalizationInAsse-212f017d

    The code sample demonstrates loading embedded resources in an assembly based on the culture information, and use it to globalize the entire ASP.NET website.  You will learn how to access resource files that has compiled in class library or dll file in ASP.NET. We give an effective way to get specific resources from compiled file and then apply resource value in whole application.

    imageimage

     

    Customized DropDownList.Se​lectedValue (CSASPNETSmartD​ropdownlist, VBASPNETSmartDropdownlist) 
    Downloads:
    C# version: http://code.msdn.microsoft.com/CSASPNETSmartDropdownlist-3e433291
    VB version: http://code.msdn.microsoft.com/VBASPNETSmartDropdownlist-42251b98

    The code sample customizes the SelectedValue property of ASP.NET DropDownList control so that it handles the situation more nicely when the SelectedValue property is set to a value that does not exist in the DropDownList value collection.  By default, an ArguementOutOfRangeException exception is thrown when SelectedValue is set invalidly.  With the customization, the DropDownList will select a "None" item when the SelectedValue is invalid.

     

    If you have any feedback, please fill out this quick survey or email us: onecode@microsoft.com

  • Microsoft All-In-One Code Framework

    Visual Studio Extension of Microsoft All-In-One Code Framework Sample Browser is Upgraded to Metro UI - You can enjoy 700+ samples from within Visual Studio

    • 2 Comments

    The Sample Browser Visual Studio Extension of Microsoft All-In-One Code Framework is upgraded!  We integrated the Sample Browser v4 released two weeks ago with Visual Studio 2010.  With this extension, you will be able to search and download samples from within your development environment!  We embrace the hope of making your sample search, download and management experience easy and enjoyable.

    Install: http://aka.ms/samplebrowservsx

    If you have any feedback and suggestions about the Sample Browser Visual Studio Extension, please don't hesitate to contact onecode@microsoft.com.

     

    After installing the extension, you can find "Search Code Sample" in the Tools menu of Visual Studio 2010. Clicking it will launch the Sample Browser inside Visual Studio.

    In the Visual Studio code editor, you can select the API that you want to search for code samples, right-click it and choose "Search Code Sample" (or press the Alt + F1 shortcut key).  This launches the Sample Browser too.  The Sample Browser automatically searches for samples based on your selected API, and filters samples according to the programming language of your current project.

     

    FAQs

    Q: I only have the Express Edition of Visual Studio 2010.  Can I use the Sample Browser?
    A: Visual Studio Express Edition does not support any Visual Studio extensions, so you cannot install this Sample Browser Visual Studio Extension in your Visual Studio Express.  However, you can use our standalone Sample Browser: http://aka.ms/samplebrowser

    Q: Does this extension support Visual Studio 2008?
    A: The current release of Sample Browser Visual Studio Extension only supports Visual Studio 2010.  However, we'll start to add its Visual Studio 2008 version if we hear a high user demand.

    Q: Why am I receiving a "The remote name could not be resolved" or "The proxy cannot be resolved" error when I search for samples?
    A: Please check your network connection.  If you are behind a proxy, please configure the proxy in the Settings page of the Sample Browser.

    Q: Why doesn't the Alt+F1 shortcut key work for me?
    A: It's because the Alt+F1 shortcut key has been assigned to other functions in your Visual Studio.  Please open Visual Studio Tools / Options.  Turn to the Environment / Keyboard tab.  In the "Press shortcut keys..." textbox, press Alt+F1. Do you see "EditorContextmenus.CodeWindow.SearchCodeSample" in the "shortcut currently used by..." dropdown list?  If no, you have to manually reassign the shortcut key to this command.

     

    Special Thanks

    We always thank customers first.  It is your feedback that helped us understand where we can do better than the last version!

    The new Sample Browser Visual Studio Extension is again developed by Leco Lin, who also developed the standalone Sample Browser.  Qi Fu tested it.  He kills bugs like a frog.  Yi-feng Li - a VSX expert and Ming Zhu - a WPF expert used their spare time to help Leco with all technical questions.  Lissa Dai worked with Jialiang Ge on the UX design.  Special thanks to Ziwei Chen - the developer of the last version of the extension - for laying a good foundation for this new version.  Special thanks to the Garage – a Microsoft internal community of over twenty-three hundred employees who like building innovative things in their free time.  These people gave us many ideas about the Sample Browser.  Special thanks to Mei Liang and Dan Ruder for their supports and suggestions.  They will next introduce the sample browser visual studio extension to other teams in Microsoft and collect feedback.  Last but not least, I want to particularly thank Steven Wilssens and his MSDN Samples Gallery team.  This team created the amazing MSDN Samples Gallery – the host of all samples.  We have a beautiful partnership, and we together make the idea of Sample Browser Visual Studio extension come true.

     

     

  • Microsoft All-In-One Code Framework

    Microsoft All-In-One Code Framework Sample Browser v4 Released – A New Way to Enjoy 700 Microsoft Code Samples

    • 18 Comments

    image

    Today, we reached a new milestone of Microsoft All-In-One Code Framework.  It gives me great pleasure to announce our newest Microsoft All-In-One Code Framework Sample Browser - v4 available to the globe.  With this release, we embrace the hope of giving global developers a completely new and amazing experience to enjoy over 700 Microsoft code samples.

    Compared with the previous version, this new version of Sample Browser is completely redesigned from tip to toe.  We heard lots of users’ voices about how we can do better.  So in Sample Browser v4, its user interface, sample search and download experience have numerous changes.  I hope that you will love our effort here.

    Install:  http://aka.ms/samplebrowser
    If you have already installed our last version of Sample Browser, you simply need to restart the application.  You will get the auto-update.

    image

    The main user interface of the Sample Browser is composed of three columns. 

    The left column is the search condition bar.  You can easily enter the query keywords and filter the result by Visual Studio versions, programming languages, and technologies.  The search history is recorded so you can resort to your past search with a single simple click.  

    In the middle, the sample browser lists the sample search result.  We added the display of the customer ratings and the number of raters.  We also integrated social media so that you can quickly share certain samples in your network – you are highly encouraged to do it!  You can selectively download the samples, or download all samples after the search is completed.

    image

    All downloading samples are queued.  You can find their download status by clicking the “DOWNLOADING” button.

    image

    If an update is available for the sample, your will be reminded to get the sample update.  The sample download and cancel are very flexible.  Enjoy the flexibility! :-) 

    The right column of Sample Browser displays the most detailed information of the selected code sample.   You can learn all properties of the sample before you decide to download it, read the sample documentation, and in the near future, we will add the “social” feature that allows you to learn what people are saying about the sample in the social network.

    Besides the above features, we added another heatedly requested one: NEWEST samples.  If you click NEWEST, the search result displays samples released in the past two months.  Clicking it again will cancel the NEWEST filter.

    image

     

    The Sample Request Service page introduces how you can request a code sample directly from Microsoft All-In-One Code Framework if you cannot find the wanted sample in Sample Browser.   The service is free of charge!

    image

    Last but not least, here is the settings page, where you can configure the sample download location and the network proxy.

    image

     

    We love to hear you feedback. Your feedback is our source of passion. Please try the Sample Browser and tell us how you think about it. Our email address is onecode@microsoft.com

     

    What’re Coming Soon?

    We never stop improving the Sample Browser!  Here are the features that are coming soon this year.

    1. Visual Studio Integration
      We will upgrade the old version of Sample Browser Visual Studio extension to the new, so you can enjoy the same experience from within Visual Studio!
    2. Expanding to all MSDN Samples Gallery samples
      Today, the Microsoft All-In-One Code Framework Sample Browser searches for only Microsoft All-In-One Code Framework code samples.  We will start to expand the scope to all samples in MSDN Samples Gallery.
    3. Add the "social" feature in the details panel to allow you to see the discussion of a sample in the social network
      image
    4. Add the "FAVORITES" feature to allow you to tag certain samples as your favorites.
    5. Add the "MINE" to allow you to add your PRIVATE samples to Sample Browser.
    6. Add the offline search function – index the downloaded samples and allow you to search samples offline.
    7. Integrate the MSDN Samples Gallery Sample Request Forum with the Sample Browser

     

    Special Thanks

    First of all, special thanks to all customers who provided feedback to onecode@microsoft.com.  Your feedback helped us understand where we can do better than the last version, and we will do better and better thanks to your suggestions!

    This new version of Sample Browser is written by our developer Leco Lin who put lots of effort on it.  Our tester Qi Fu tested the application and strangled the bugs.  Jialiang Ge designed the features and functions of the Sample Browser.  The UI is worked out by Lissa Dai and Jialiang together.  Special thanks to Anand Malli who reviewed the source code of Sample Browser and shared lots of suggestions.  Special thanks to Ming Zhu and Bob Bao who gave seamless technical support of WPF to Leco and smoothened the development.  Special thanks to the Garage – a Microsoft internal community of over twenty-three hundred employees who like building innovative things in their free time.  These people gave us many ideas about the Sample Browser.  Special thanks to Mei Liang and Dan Ruder for their supports and suggestions.  They will next introduce the sample browser to other teams in Microsoft and collect feedback.  Last but not least, I want to particularly thank Steven Wilssens and his MSDN Samples Gallery team.  This team created the amazing MSDN Samples Gallery – the host of all samples.  We have a beautiful partnership, and we together make the idea of Sample Browser come true.

  • Microsoft All-In-One Code Framework

    Targeting TOP sample quality, All-In-One Code Framework is on its way

    • 2 Comments

    Quality - quality – quality.  This hallowed word dictates what we ought to be, what we can be, what we will be.  Targeting TOP sample quality, All-In-One Code Framework starts its new round of quality enhancement in the new fiscal year at Microsoft.

    With Microsoft Global Developer Support Cluster Lead – Jamie Burroughs and his groups’ full supports, hundreds of Subject Matter Experts (SMEs) throughout the Microsoft Developer Support cluster are on board of All-In-One Code Framework.  These experts stand for the best talents of each technical area in Microsoft CSS.  They will not only triage all sample ideas, review all code samples before publishing, but also directly contribute code samples based on customers' pains observed in CSS phone support incidents.

    Before the end of 2011, the All-In-One Code Framework team and the SMEs are revisiting 400 old code samples that were created when the project was started.  We will

    • revisit their sample quality
    • update samples to the latest SDKs and Visual Studio
    • make up for the missing programming languages
    • upgrade the sample documentation format from the traditional .txt plain text ReadMe files to rich-text htm documentation.  Pictures, code snippets will be added to the sample documentations to make them more illustrative and easier to follow.

    In the meantime, we will start to closely monitor the customer rating and Q/As of our code samples in the MSDN Samples Gallery.  We look forward to your rating, and we appreciated if you could write some comments in the Q/A page besides rating so that we can know how to improve the sample.  Our target is to provide 5-star samples!

    The technical talents are ready, the target is set, and the game is on.  Teams will work with sheer dedication to try to attain the goal of TOP quality!

  • Microsoft All-In-One Code Framework

    Sharing the MSDN Forum Assistant – an instant and easy way to search for a resolution in MSDN forums

    • 4 Comments

    As a developer, are you continuously looking for technical support resources? Frustrated with program crashes? Or struggling to meet your customers expectation? The new MSDN Forum Assistant reduces your efforts of logging in and directs you to the MSDN forum with instant updates, forum FAQs, MSDN priority support queues, and much more! It is like having an expert right on your desktop.

    Download link: http://www.microsoft.com/download/en/details.aspx?id=27747

    The MSDN Forum Assistant features the function of directly asking questions in the forum. The MSDN Forum Assistant delivers post updates directly to your desktop; no need to refresh IE.  “Thread updates”  is definitely the right place to keep on track. You can type your key words in MSDN assistant to search MSDN official Forum directly for related posts. No matter if you are a beginner trying to master basic knowledge, or an experienced developer who still wants to learn more , “Forum Q & A” can get you the hottest questions by Microsoft engineers.

    Developers' frequently asked programming tasks in the MSDN forums are the source of Microsoft All-In-One Code Framework sample topics.  We will monitor all MSDN forums, collect developers' typical pains and needs, and provide the code samples - free of charge.

     

Page 1 of 12 (112 items) 12345»