Visual Studio LightSwitch 2011 Tutorial Video

Just another awesome server – Team Foundation Server 2010

Hi Everyone,

I recently attended a seminar on topic “Visual Studio 2010 features and Team Foundation Server 2010”. It was taken by Mr. Sinjinth HR from Microsoft. He works in the Visual Studio Team. I really enjoyed the seminar and the contents of the seminar were also very useful specially the demos.

Have anybody previously used the Performance wizard in Visual Studio 2010? If you didn’t, then please go through it. It is really awesome to get the statistics of your code and it also tells you about the time complexity and other performance based attributes.

Some of the features of the TFS 2010 explained in webinar were:

1) Work Item Tracking

2) Version Control

3) Build Automation

4) Reporting ( Different charts )

5) Project Management

The concepts regarding the Shelving and Branching are really good. He explained it very briefly. If you don’t know about the features of Team Foundation Server 2010, then you can see video attached below. This video explains concept in a better way rather than me writing all the learnt stuff here. 😛

Enjoy 🙂

Hi Everyone,

Today, I am coming up with the topic of “serialization in .net framework” .  There are three types of serialization techniques present in the .net framework. They are briefly explained as follows:

1) Binary Serialization
2) XML serialization
3) Soap Serialization

In this article, I will not focus on the theoreotical part rather will focus on how you can implement these concepts in the simple application.

Let us consider a sample application of Notepad Font. As we know, when we open a notepad application, we see the font of the text which we have set earlier at the last execution of notepad.

( Please note: This is not relevant to a particular file. Every file is opened in the same font which is set earlier in notepad )

Following is the code for binary serialization in the .cs file:

MainFont obj = new MainFont();
obj.Fnt =  RTBArea.Font;

FileStream fs;

fs = new FileStream(@”font.dat”, FileMode.Create, FileAccess.Write,  FileShare.Read);

BinaryFormatter binF = new BinaryFormatter();

binF.Serialize(fs, obj);

fs.Close();

In the above code, MainFont is the class whose namespace is as follows:

namespace Notepad
{
    [Serializable]
    public class MainFont
    {
              private Font fnt;
              public Font Fnt
             {
                      get { return fnt; }
                      set { fnt = value; }
             }
     }
}

Using the above code, you will be able to serialize the font set by the user in your notepad ( i.e. Rich Text Box )

Now, we have to deserialize the object which we have saved earlier.

To deserialize the object, write the following code in the load event of the application:

FileStream fsw;
            MainFont mf = new MainFont();

             fsw = new FileStream(@”font.dat”, FileMode.Open, FileAccess.Read,FileShare.Read);

             BinaryFormatter binF1 = new BinaryFormatter();
             mf = (MainFont)binF1.Deserialize(fsw);

            RTBArea.Font = mf.Fnt;

By using the above code, it will deserialize the font object present in the font.dat file and the font is assigned to the RTBArea font.

I have provided with the code for the Binary serialization in this article. If you want to implement soap and xml serialization, then you just have to use the XMLSerializer class and use references “System.Runtime.Serialization.Formatters.Soap” and “System.Runtime.Serialization.Formatters.xml”.

Note: For using the XMLSerializer, the members of the class should be public.

Enjoy 🙂

Scaling application controls size according to surrounding container

Hi Friends,

While developing the application in Windows Presentation Foundation, you might face with issue of scaling the application. If you want to run your application into different display of different resolutions then you might need to scale up/down your application to regain the application controls at the right position as they were present before.

  • For the resolution Independence of application, you should place your into the ViewBox which defines a content decorator that can stretch and scale a single child to fill the available space.
  • In this way, whenever you will re-size the window, your application controls will also re-size with the same aspect ratio and automatically will get stretched and scaled properly.
  • If you are using Expression Blends, then a snapshot of Objects and Timeline is added for your referral as how to add the controls in viewbox.

  • In the figure above, Grid contains all the controls which are used inside the application and the same grid is placed inside the viewbox control which is included in the main window.

Enjoy 🙂

Hi Friends,

I have seen many people facing problem with autoconfiguration of IPv4 and IPv6 addresses in windows 7 operating system.

Basic Problems:

  • Problem in connecting to the network  with any IP input.
  • Problem in  changing or disabling Autoconfiguration IPv4 or IPv6 Address which is shown in ipconfig command.
Solutions:
  1. Type ” netsh winsock reset ” ( without quotes ) in the Command Prompt and press Enter.  ( Winsock is basically a specification of how networking software accesses the network services )
  2. Type netsh interface ipv4 reset   in command prompt and press Enter. ( For IPv4 address )
  3. Type netsh interface ipv6 reset   in command prompt and press Enter. ( For IPv6 address )
  4. ipconfig /flushdns   press Enter. ( Flushes the dns )

Finally Restart your Computer and you are done!

Enjoy 🙂

Hi Friends,

I am currently working on a project using a Windows Presentation Foundation in Visual Studio 2010 Ultimate. In one module, I decided to provide some reports to the client. The few problems I came across in the generation of reports are as follows:

  • The Report viewer native control is not directly available in WPF. So, we can’t directly place and use the control for report generation.
  • Binding of the data source to the report viewer in Visual Studio 2010 Ultimate as it requires a different approach than Visual Studio 2008 Express Edition.
  • Passing the parameters to the report viewer.

Continue reading “Using a Report Viewer Control in Windows Presentation Foundation ( WPF )”

Generate Different Charts using Silverlight Toolkit

Hey Friends,

In this article, I will be telling you all about the method using which you can generate the charts with the help of Silverlight Toolkit which is freely available for download from here.

Before starting the actual process, you must download the Silverlight 4 from here.

After installing the Silverlight 4 and the toolkit, Create a new project in Visual Studio 2010 of Silverlight and while creating a new project ensure that you check the enable WCF services option. ( This option is useful if you are using the WCF services for your project )

After creating a new project, add the following references to the project.

I am considering the sample data for the simple chart that we want to make. We create a new class as follows:

Now we have two variables CustName and Orders which are defined inside the MyClass Class. Our Chart will show the data about the Customer Name and Orders in the Line Chart. So using the following code sample,

Above code sample indicates which data will be represented in the chart. We have Created a MyClassObj object of the List of MyClass Class and then we are adding the Data of the five people inside the Chart to display.
Now, to call this we need an object of RoutedEventHandler, so
:)

Now we also have to change the MainPage.xaml file for the display purpose of the chart, refer the below code for the same:

We are generating the simple LineSeries Chart using the above code. If one wants to display a PieSeries, BubbleSeries, ScatterSeries, ColumnSeries or Series Like all the Stacked Series, then just change the LineSeries from the code and you are done for the respective series which are available in the Silverlight Toolkit. 🙂

After doing all this, just run the application and the following lineSeries will be generated :

Similarly, if you generate the other series then you will get the following charts:

Bubble Chart

Pie Chart

Area Chart

So, there you are ready with all the Charts using the Silverlight Toolkit and those look awesome for your dashboard, aren’t they? 😉

Enjoy 🙂