Visual Studio 2010 new features series

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. This post will list all the posts related to Visual Studio 2010 in this blog, be it C# 4, visual basic 2010, .net framework 4 or Visual Studio 2010 IDE specific, you can find it here going forward. These posts will include tiny improvements to mega-features introduced in Visual Studio 2010.   Some new features of Visual Studio 2010 that can help your productivity right away Visual Studio 2010 New Features in Debugging – Exciting & Innovative What can you do with ‘IntelliTrace’ in Visual Studio 2010  New ASP.NET project gives a great webapp template in Visual Studio 2010 C# 4 new features ~ Basic method invocation changes – Optional and Named parameters Auto-Implemented properties comes to Visual Basic 2010 New Stream.CopyTo() in .Net framework 4   As and when I find cool new features in Visual Studio 2010, I always hoped to write about them. I wish to have extreme time management capabilities, atleast from now… 🙂   (Note: All posts are as per things I said here, so if it suits any of those points, I will write 🙂 )

What can you do with ‘IntelliTrace’ in Visual Studio 2010

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. (This post is part of my Visual Studio 2010 series) As I wrote in my earlier article, Visual Studio 2010 has many new features in debugging. IntelliTrace is one of the major features of Visual Studio 2010 and as of now it is available only in Visual Studio 2010 Ultimate edition. In my opinion, IntelliTrace is the best reason to convince your boss to get Ultimate edition for you :). Note, IntelliTrace only supports managed code, for example, it doesn’t support vc++ native code. [more] This article introduces IntelliTrace and tells how it helps in simplifying debugging and tells some more things that can be done with it (based on Visual Studio 2010 ultimate edition-release candidate). (I am taking the intro from previous post..) Introducing Visual Studio 2010’s IntelliTrace.. IntelliTrace is a feature previously known as Historical debugging, which is a major enhancement made to the Visual Studio 2010 debugger. When an exception occurs, you usually start debugging with breakpoints set in suspected areas and check variable/object values for correctness. But if an exception occurs when IntelliTrace is enabled, it allows you to just go

Auto-Implemented properties comes to Visual Basic 2010

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. (This post is part of my Visual Studio 2010 series) In C# we can create properties for classes in simple way by just specifying the below code, this option is called auto-implemented property, as the implementation is taken care by the compiler.[more] public int Price { get; set; }   In Visual Basic we don’t have such simple option to create properties, hence to create a simple class we have to write the below code.. Class Client Private _Code As String Public Property Code() As String Get Return _Code End Get Set(ByVal value As String) _Code = value End Set End Property Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Private _CreditLimit As Single = 2000 Public Property CreditLimit() As Single Get Return _CreditLimit End Get Set(ByVal value As Single) _CreditLimit = value End Set End Property End Class   But in Visual Basic 2010(in Visual Studio 2010) we can write the below code instead of the above.. Class Client Public Property Code As String Public Property Name

New Stream.CopyTo() in .Net framework 4

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. (This post is part of my Visual Studio 2010 series) Stream.CopyTo() is a new method added to System.IO.Stream in .Net framework 4, which allows you to copy bytes from one stream to another easily and makes your code simple.[more]   FileStream sourceStream = new FileStream(@”G:\test\art.bmp”, FileMode.Open); FileStream targetStream = new FileStream(@”G:\test\art-copy.bmp”, FileMode.CreateNew); sourceStream.CopyTo(targetStream); targetStream.Close(); sourceStream.Close();   This method is also available in MemoryStream(any subclass of System.IO.Stream). This is a notable method if you especially do more file IO in your application, you may also look at your old code for chances to refactor it with this method(if you have time 🙂    Subscribe to the feed! (?) and receive any such future posts on your favorite feed reader Any comments? write here..  

More secure gmail?

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. Just a quick tip.. if your gmail url is http://mail.google.com/mail/?shva=1# you might be wondering whether it is secure(as it is not https), it isn’t so secure, but recently Gmail changed its default mode to https, most people get the url as https when they login currently. [more]But if you still see only http, then to make gmail more secure, go to your gmail Settings and enable “Always use https” “..If you sign in to Gmail via a non-secure Internet connection, like a public wireless or non-encrypted network, your Google account may be more vulnerable to hijacking. Non-secure networks make it easier for someone to impersonate you and gain full access to your Google account, including any sensitive data it may contain like bank statements or online log-in credentials…”   More here..

Accessing parent window from child window or vice versa in JavaScript

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. [Note: I wrote this article few years back, when I got few hours of free time to explore these; thought of putting it here as it has a set of different techniques which is helpful for someone facing this scenario and could be a reference for me, initially written for beginners/intermediates] This article explains options available to access the data present in a parent window from a child window or vice versa in JavaScript. By telling the word Parent I mean the browser window that opens another browser window, the new window is what I call Child window. [more]At times when you are developing a web application you could face a situation, where there is a need to use JavaScript to access the HTML forms and controls present in a parent window from a popup window(child window) or something similar, this article provides few solutions for accomplishing this. I am considering only Internet Explorer and Firefox for this article, these options may work in other browsers also. I am going to mention the options available in JavaScript that someone can use immediately in their work,

C# 4 new features ~ Basic method invocation changes – Optional and Named parameters

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. (This post is part of my Visual Studio 2010 series) C# 4 brings many new features, couple of them are optional parameters and named parameters. If you have used Visual Basic, you know these features are already available in VB. Adding these to C# makes it even better and helps C# coders who are from visual basic. [more] Optional parameters Optional parameters allows you to create methods with default values for some parameters, so that you can ignore passing values to them. Like.. public string ReadFile(string FileName = “Defaultfile.xml”) { .. } .. string str1; str1 = ReadFile(); //optional parameter ignored string str2; str2 = ReadFile(“Orders.xml”);   You have to specify a value to the optional parameter in function definition as above, this will be used if you don’t supply a value while calling the method. Quick info(Ctrl+I) helps more by showing the optional parameter’s default value. Until C# 3, we had to create unnecessary method overloads if we have to avoid some of the parameters of a method for simplification, instead, now we can specify a default value and code the method appropriately. If

Visual Studio 2010 New Features in Debugging – Exciting & Innovative

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. (This post is part of my Visual Studio 2010 series) This article talks about Visual Studio 2010’s new features related to debugging, applicable from beginner to expert(based on Visual Studio 2010 beta 2). Visual Studio 2010 comes with powerful debugging features. Debugging is an area where an improvement brings great relief to developers, and increases developer happiness. Visual Studio 2010 seems to highly enhance debugging support, and can change some basic ways we used to debug applications, let us have a look.[more] Export/Import Breakpoints By using Export/Import breakpoints in Visual Studio 2010, you can debug a portion of the application and export the current set of breakpoints and import it back whenever you want to debug the same portion of application, no matter what breakpoints you have currently placed in your code. This feature will enable you to have different set of breakpoints for each scenario or portion of application that you may need to debug. This is one of the features that I highly wished to have. An example scenario… consider your web page/windows form has basic CRUD(Create/Read/Update/Del) options, you are currently working on

The (not much utilized) Debug->Exceptions… window technique

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. The Debug-Exceptions… window is a useful tool that at times saves lot of time when debugging. Even though this exists (i think)from Visual Studio 2003, I Still find people struggle a bit with the situation I am going to explain next.[more] As you know Visual Studio highlights the exception code line when it is not handled. Sometimes we purposely don’t handle exceptions in a method and let the exception thrown to calling functions.   Usually we have a multi-project solution that typically has layers like Business logic, Data access layer, UI, etc. Imagine that you make a call from the UI to a local function and it calls another function in BLL and the call goes deep into layers of your project architecture. Now, when it is not sure if each of the methods getting called handles exceptions in it or doesn’t throw identifiable exceptions. For instance.. private void Function_A() {     try     {         BLLFunction();//this calls few other functions..     }     catch (Exception ex)     {         //handle exception     } } Function_A() calls BLLFunction() and it again calls few other functions,

Gmail ignores dots..a gmail secret..

(Note: This blog post was originally published under my old domain(codesmiles.com), here. Web Archive link. It is bit old but still a surprise for many. What is your gmail id? is it your.name@gmail.com ? so in the login page you will give your.name as your Username, right? But instead try “yourname” as username… Gmail allows you to login.[more] Surprised? Gmail ignores dots in email ids a.b.c@gmail.com is same as abc@gmail.com If you receive an email ignoring dots in your gmail id then it will show as above… More in this link… But there is a small problem in this.. you register in a third party site with “.” in your Gmail id and after some time you decide to ignore dots in your email, now you try to use the third party site’s forgot password option and if you didn’t remember that you have used “.” when you registered, then you may lose your account in the site. This is because for other sites your.name@gmail.com is different from yourname@gmail.com.