h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Visual Studio Productivity Power Tools Update

Visual Studio Productivity Power Tools Update

Microsoft has updated the free Productivity Power Tools for Visual Studio 2010.
These are add-ins that provide very useful additional functionality for Visual Studio.
New in this release:

  • No More Extension Resets
  • Find 
  • Enhanced Scrollbar
  • Middle-Click Scrolling
  • Organize Imports for Visual Basic
Visual Studio Productivity Power Tools Update link

Happy New Year Wishes To All


  • A Little key can open big locks Simple words reflect great thoughts Your smile can cure heart problems So keep on smiling more and more Have a happy new year full of smile. 
  • Peace In Your Heart, Health In Your Body, Wealth In Your Life, Joy In Your Home, May U Always Be Blessed With These Priceless Treasures Happy New Year.
Happy New Year  to All Readers and friends.

C# Internal Interface

C# Internal Interface

          you can not declare Encapsulation in the Interface like Public
Example for Internal Interface.
Here , One class and Two Interface in the coding.
Class Name:MyClass
Interface Names :IMyPublicInterface,IMyInternalInterface

Create  Normal  interface

public interface IMyPublicInterface
{
    void MyPublicMethod();
}
Create  Internal  interface
internal interface IMyInternalInterface
{
    void MyInternalMethod();
}
Inherited two interface into One class using Colon(:)
public class MyClass :
    IMyPublicInterface, IMyInternalInterface
{
/// Called interface methods in the Class
    public void MyPublicMethod() { }
    void IMyInternalInterface.MyInternalMethod() { }
}

Explicit interface member implementations

Explicit interface member implementations
             An explicit interface member implementation is a method, property, event, or indexer declaration that references a fully qualified interface member name.

Example for Explicit interface member implementations
interface IControl
{
   void Paint();
}
interface ITextBox: IControl
{
   void SetText(string text);
}
class TextBox: ITextBox
{
   void IControl.Paint() {...}
   void ITextBox.SetText(string text) {...}
}

Zoom the View in Visual Studio

Zoom the View in Visual Studio

Keyboard Shortcuts

  • To make the font larger, press CTRL+SHIFT+PERIOD
  • To make the font smaller, press CTRL+SHIFT+COMMA


Dictionary initializer in C# 6.0

Dictionary initialize in C# 6.0
            Adds a new ability to use the Key / indexer to map with the Values directly during the initialization itself.

Dictionary<int, string> students = new Dictionary<int, string> {
[1] = "Student 1" ,
[2] = "Student 2",
[3] = "Student 3",
[4] = "Student 4",
};

Dictionary initializer in C#

Dictionary initialize in C# 

  You can easily initialize a Dictionary Object using a Collection Initialize, which is there since C# 3.0.
  Collection initialize adds one of the  parameter as Key and another as  Value corresponding to the assigned Key.

Dictionary<int, string> students = new Dictionary<int, string> {
{1, "Student 1" },
{2, "Student 2" },
{3, "Student 3" },
{4, "Student 4" }
};
Find Public Key Token  for dll in Visual Studio

Use .Net Framework Tool sn.exe
Open the Visual Studio 2008 Command Prompt and then point to the dll’s folder you want to
get the public key,

Use the following command,
sn –T myDLL.dll
This will give you the public key token. Remember one thing this only works if the assembly has to be strongly signed.

New Features of C# 6.0

New Features of C# 6.0

  • Initialization of Dictionary – Dictionary initializer in C# 6.0
  • Null – Conditional Operators in C# 6.0
  • Using nameof Operator in C# 6.0
  • Conditional Exception Handling – Exception Filters in C# 6.0
  • Using await in a catch or finally block – in C# 6.0
  • Expression – Bodied Methods in C# 6.0
  • Simplify Static Member Access – Using Statement With Static Classes in C# 6.0
  • Easily format strings – String interpolation in C# 6.0
  • Initialize Auto-Property in C# 6.0
  • Getter Only Auto-Property in C# 6.0


Tips to improve performance of C# code

Tips to improve performance of C# code

  • Choose your data type before using it
  • Use For loop instead of foreach
  • Choose when to use a class and when to use a structure
  • Always use Stringbuilder for String concatenation operations
  • Choose best way to assign class data member
  • Boxing and UnBoxing
  • ‘as’ versus type casting
  • Control overflow checking
  •  Using readonly versus const
  • Avoid producing a lot of garbage
  • Avoid using finalizers when possible
  • Recycle and/ or cache objects
  • Reduce class hierarchy
  • Avoid explicitly calling the Garbage Collector
  • Avoid synchronization
  • Use Lazy Evaluation
  •  Optimized classes
  •  Explicitly close resources
  • Limit number of threads
  • Ternary Operator (?:)
  •  Null-Coalesce Operator (??)
  • Namespace Alias Qualifier
  • Object Initializers
  • Nullable Types
  • Type Inference
  • Lambda Expressions



Volatile -- C# Keyword

volatile -- C# Keyword


  • The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access.
  • The volatile keyword can be applied to fields of these types:
  • Reference types.
  • Pointer types (in an unsafe context). Note that although the pointer itself can be volatile, the object that it points to cannot. In other words, you cannot declare a "pointer to volatile."
  • Types such as sbyte, byte, short, ushort, int, uint, char, float, and bool.
  • An enum type with one of the following base types: byte, sbyte, short, ushort, int, or uint.
  • Generic type parameters known to be reference types.
  • IntPtr and UIntPtr.

public volatile <data type> <Var Name>;

virtual -- C# Keyword

virtual -- C# Keyword
         The virtual keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class.

 public virtual <Data Type> <Method Name>()
{
///Code
  return <Value>
}

unsafe -- C# Keyword

unsafe -- C# Keyword
           The unsafe keyword denotes an unsafe context, which is required for any operation involving pointers.

Without  Parameter
unsafe
{
    // Unsafe context: can use pointers here.
}
With Parameter(s)
unsafe static void <Method Name>(<data Type> <var name>)
{
    // Unsafe context: can use pointers here.
}

static -- C# Keyword

static  -- C# Keyword


  • Use the static modifier to declare a static member, which belongs to the type itself rather than to a specific object.
  •  The static modifier can be used with classes, fields, methods, properties, operators, events, and constructors, but it cannot be used with indexers, destructors, or types other than classes.
static class <Class Name>
    {
        public static void <Method Name>() { /*...*/ }
        public static void <Method Name>() { /*...*/  }
    }

sealed -- C# Keyword

sealed  -- C# Keyword

  •  When applied to a class, the sealed modifier prevents other classes from inheriting from it.
  •   In the following example, class B inherits from class A, but no class can inherit from class B.


class A {}  
sealed class B : A {}

readonly -- C# Keyword

readonly -- C# Keyword
  •  The readonly keyword is a modifier that you can use on fields.
  •   When a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class.
readonly <data Type> <var Name>;

override -- C# Keyword

override -- C# Keyword


  •  The override modifier is required to extend or modify the abstract or virtual implementation of an inherited method, property, indexer, or event.
  • An override declaration cannot change the accessibility of the virtual method.
  • Both the override method and the virtual method must have the same access level modifier.
  • You cannot use the new, static, or virtual modifiers to modify an override method.

out -- C# Keyword

out -- C# Keyword

  • This keyword implemented from VS 2010
  •  The out keyword specifies that the type parameter is covariant.
  • You can use the out keyword in generic interfaces and delegates.

interface <interface Name><out R> { }

extern -- C# Keyword

extern -- C# Keyword

  •  The extern modifier is used to declare a method that is implemented externally.
  • A common use of the extern modifier is with the DllImport attribute when you are using Interop services to call into unmanaged code.
  • In this case, the method must also be declared as static, 

[DllImport("<dll Name>.dll")]
private static extern void <dll Method Name>();

const -- C# Keyword

const  -- C# Keyword
  • You use the const keyword to declare a constant field or a constant local.
  •  Constant fields and locals aren't variables and may not be modified.
  •  Constants can be numbers, Boolean values, strings, or a null reference.
const <Data Type> <Var Name> = <Set Value>;

Protected -- C# Keyword

Protected  -- C# Keyword:


  • The protected keyword is a member access modifier.
  • A protected member is accessible within its class and by derived class instances.

 protected <Data Type> <Variable Name>;

async -- C# Keyword

async  -- C# Keyword


  • This Keyword is implemented from VS 2012.
  •         Use the async modifier to specify that a method, lambda expression, or anonymous method is asynchronous.
  •         If you use this modifier on a method or expression, it's referred to as an async method.

public async Task<int> ExampleMethodAsync()
{
    // . . . .

}

in -- C# Keyword

in -- C# Keyword


  •    This Keyword is implemented from VS 2010.
  •    The in keyword specifies that the type parameter is contravariant.
  •    You can use the in keyword in generic interfaces and delegates.

// Contravariant interface.

interface <Interface Name><in A> { }

Insert ,Update ,Delete and Display in Datagridview using LINQ To SQL in C#.Net

Insert ,Update ,Delete and Display in Datagridview using LINQ To SQL in C#.Net

Create tables in SQL server
tbl_department_master
depId  int -- Primary Key -- Set Identify is true
DepName -- varchar(Max)

tbl_Position_Master
PatId int -- Primary key
Patname-- varchar(Max)

Add LINQ To SQL in the your project
Go To Server Explore
Add Data Connection
Drag Tables into LIQToSQL Class
Create user Control

Add User Control in your Project.
Add Datagridview and Two buttons on the User Control
Declare Variables ,Data Context  and Events
 DataClasses1DataContext objDC = null;
 tbl_Department_Master objDM = null;
 tbl_Position_Master objPM = null;
public event EventHandler SaveClicked;
public event EventHandler CloseClicked;
/// To Display Data
 public void Displaydata(string mode)
        {
            switch (mode)
            {
                case "Department":
                    DisplayData("Department");
                    break;
                case "Position":
                    DisplayData("Position");
                    break;
            }
        }
 private void DisplayData(string mode)
        {
            objDC = new DataClasses1DataContext();
            switch (mode)
            {
                case "Department":
                    var query = from q in objDC.tbl_Department_Masters
                                select q;
                    dataGridView1.DataSource = query;
                    break;
                case "Position":
                    var Posquery = from Pq in objDC.tbl_Position_Masters
                                   select Pq;
                    dataGridView1.DataSource = Posquery;
                    break;
            }        
        }
/// Delete Data
 private void DeleteData(string mode)
        {
            objDC = new DataClasses1DataContext();
            switch (mode)
            {
                case "Department":
                    objDM = new tbl_Department_Master();
                    if (objDM != null)
                    {
                        var Delet = from d in objDC.tbl_Department_Masters
                                    select d;
                        foreach (var details in Delet)
                        {
                            objDC.tbl_Department_Masters.DeleteOnSubmit(details);
                        }
                        objDC.SubmitChanges();
                    }
                    break;
                case "Position":
                    objPM = new tbl_Position_Master();
                    if (objPM != null)
                    {
                        var Delet = from d in objDC.tbl_Position_Masters
                                    select d;
                        foreach (var details in Delet)
                        {
                            objDC.tbl_Position_Masters .DeleteOnSubmit(details);
                        }
                        objDC.SubmitChanges();
                    }
                    break;
            }
        }
/// Save Data
public void SaveData(string mode)
        {
            switch (mode)
            {
                case "Department":
                    DeleteData("Department");
                    objDC = new DataClasses1DataContext();
                    for (int index = 0; index < dataGridView1.Rows.Count - 1; index++)
                    {
                        objDM = new tbl_Department_Master();
                        objDM.depId = Convert.ToInt32(dataGridView1.Rows[index].Cells[0].Value);
                        objDM.DepName = Convert.ToString(dataGridView1.Rows[index].Cells[1].Value);
                        objDC.tbl_Department_Masters.InsertOnSubmit(objDM);
                        objDC.SubmitChanges();
                    }
                    DisplayData("Department");
                    break;
                case "Position":

                    DeleteData("Position");
                    objDC = new DataClasses1DataContext();
                    for (int index = 0; index < dataGridView1.Rows.Count - 1; index++)
                    {
                        DataGridViewRow objRowIndex = new DataGridViewRow();
                        objPM = new tbl_Position_Master();
                        objPM.PatId = Convert.ToInt32(dataGridView1.Rows[index].Cells[0].Value);
                        objPM.Patname = Convert.ToString(dataGridView1.Rows[index].Cells[1].Value);
                        objDC.tbl_Position_Masters.InsertOnSubmit(objPM);
                        objDC.SubmitChanges();
                    }
                    DisplayData("Position");
                    break;
            }
        }

Call this User Control in your form:

Add the code in your code Page

private void DisplayData(string mode)
        {
          switch (mode)
            {
                case "Department":
                    ucDepartment1.Displaydata("Department");
                    break;
                case "Position":
                    ucDepartment1.Displaydata("Position");
                    break;
            }

        }

        private void FrmDepartment_Load(object sender, EventArgs e)
        {
            DisplayData("Position");
        }

        private void ucDepartment1_Load(object sender, EventArgs e)
        {

        }

        private void ucDepartment1_CloseClicked(object sender, EventArgs e)
        {
            ((Form)this.TopLevelControl).Close();
        }

        private void ucDepartment1_SaveClicked(object sender, EventArgs e)
        {
            ucDepartment1.SaveData("Position");

        }

do -- C# Keyword

do -- C# Keyword

  •   The do statement executes a statement or a block of statements repeatedly until a specified expression evaluates to false.
  •       The body of the loop must be enclosed in braces, {}, unless it consists of a single statement.
  •       In that case, the braces are optional.
        do
        {
              ///Write your Code        

        } while ();

Abstract -- C# Keywords

Abstract Classes and Abstract Methods in C#.NET

Abstract Classes:

  •   Provide default functionality to its sub classes.
  •   Contain methods with complete implementation, besides abstract methods.
  •   Contains at least one abstract method, then the class must be declared as abstract class.


//Abstract class
    abstract class <Class Name>
    {

        protected float <Var Name>;

        //Abstract methods can have only declarations
        public abstract <DataType> <Method Name>();
         ///Method with Paramenter
        public abstract <DataType> <Method Name>(<DataType> obj);

    }

class  <Class Name(child Class)> : <Class Name(Parent Name)>
{
        public Override <DataType> <Method Name>();
{
/// Write your Code
}

        public Override <DataType> <Method Name>(<DataType> obj);
{
/// Write your Code
}

}

Tips to improve Entity Framework Performance

Tips to improve Entity Framework Performance


  • Avoid to put all the DB Objects into One Single Entity Model
  • Disable change tracking for entity if not needed
  • Use Pre-Generating Views to reduce response time for first request
  • Avoid fetching all the fields if not required
  • Choose appropriate Collection for data manipulation
  • Use Compiled Query wherever needed
  • Retrieve only required number of records
  • Avoid using Contains
  • Avoid using Views
  • Debug and Optimize LINQ Query

ADO.NET Entity Framework Version

ADO.NET Entity Framework Version

Version : 3.5
  This release provided basic O/RM support using the Database first development.
Version: 4.0

  • Model-first development
  • POCO support
  • Lazy Loading
  • T4 Code Generation

Version :4.1

  • Code First development
  • Introduced DbContext API
  • Data Annotations and Fluent API Validation

Version: 4.2
The EF 4.2 release included the bug fixes to EF 4.1
Version: 4.3

  • Code First Migrations
  • Automatic Migrations

Version 5.0

  • Enum Support in Code First and EF Designer
  • Spatial Data Types in Code First and EF Designer
  • Table-Valued Functions
  • Multiple Diagrams per Model

Version 6.0:

  • Async Query and Save
  • Code-Based Configuration
  • Dependency Resolution
  • Interception/SQL logging
  • Improved Connection Management
  • Improved Transaction Support


Difference between Lazy Loading and Eager Loading

Difference between Lazy Loading and Eager Loading

Lazy/Deferred Loading
       In case of lazy loading, related objects (child objects) are not loaded automatically with its parent object until they are requested.
       By default LINQ supports lazy loading.

Eager loading

      In case of eager loading, related objects (child objects) are loaded automatically with its parent object. To use Eager loading you need to use Include() method.

Type of Inheritance in Entity Framework

Type of Inheritance in Entity Framework

1) Table-Per-Hierarchy(TPH):

The TPH inheritance states that all entities, in a hierarchy of entities, are mapped to a single table in storage schema. It means, there is only one table in database and different Entity types in Entity model
public class Employee
{
 public int EmployeeID { get; set; }
 public string EmployeeName { get; set; }
}
public class EmployeeDetails : Employee
{
 public string EmployeeAddress { get; set; }
 public string EmployeeMobile { get; set; }
}
public class EmployeeLogin : Employee
{
 public string UserName { get; set; }
 public string Password { get; set; }
}
Entity Framework Code First Mapping for TPH
modelBuilder.Entity<Employee>()
 .Map<EmployeeDetails>(m => m.Requires("Type").HasValue("EmployeeDetails"))
 .Map<EmployeeLogin>(m => m.Requires("Type").HasValue("EmployeeLogin"));

2) Table-per-Type (TPT)
        The TPT inheritance states that each entity in the hierarchy of entities is mapped to a separate table in storage schema. It means, there is separate table in database to maintain data for each Entity Type.
public class Employee
{
 public int EmployeeID { get; set; }
 public string EmployeeName { get; set; }
}
public class EmployeeDetails : Employee
{
 public string EmployeeAddress { get; set; }
 public string EmployeeMobile { get; set; }
}
public class EmployeeLogin : Employee
{
 public string UserName { get; set; }
 public string Password { get; set; }
}
Entity Framework Code First Mapping for TPT
modelBuilder.Entity<Employee>().ToTable("Employee");
modelBuilder.Entity<EmployeeLogin>().ToTable("EmployeeLogin");
modelBuilder.Entity<EmployeeDetails>().ToTable("EmployeeDetails");
Table-per-Concrete-Type (TPC)
          The TPC inheritance states that each derived entity (not base entity) in the hierarchy of entities is mapped to a separate table in storage schema.
          It means, there is separate table in database to maintain data for each derived entity type.
          This inheritance occurs when we have two tables with overlapping fields in the database like as a table and its history table that has all historical data which is transferred from the main table to it.
public abstract class Employee
{
 public int EmployeeID { get; set; }
 public string EmployeeName { get; set; }
}
public class EmployeeDetails : Employee
{
 public string EmployeeAddress { get; set; }
 public string EmployeeMobile { get; set; }
}
public class EmployeeLogin : Employee
{
 public string UserName { get; set; }
 public string Password { get; set; }
}
Entity Framework Code First Mapping for TPC
modelBuilder.Entity<EmployeeDetails>().Map(m =>
{
 m.MapInheritedProperties();
 m.ToTable("EmployeeDetails");
});
modelBuilder.Entity<EmployeeLogin>().Map(m =>
{
 m.MapInheritedProperties();
 m.ToTable("EmployeeLogin");
});

XAML

Introduction to XAML
XAML stands for Extensible Application Markup Language.
Its a simple language based on XML to create and initialize .NET objects with hierarchical relations.
All classes in WPF have parameterless constructors and make excessive usage of properties.
Advantages of XAML
All you can do in XAML can also be done in code.
XAML is just another way to create and initialize objects.
You can use WPF without using XAML.
It's up to you if you want to declare it in XAML or write it in code.

Declare your UI in XAML has some advantages:
XAML code is short and clear to read
Separation of designer code and logic
Graphical design tools like Expression Blend require XAML as source.
The separation of XAML and UI logic allows it to clearly separate the roles of designer and developer.

Properties as Elements
Properties are normally written inline as known from XML <Button Content="OK" />.
we can use the property element syntax. This allows us to extract the property as an own child element.
Syntax:
<Button>
  <Button.Content>
     <Image Source="Images/OK.png" Width="50" Height="50" />
  </Button.Content>
</Button>

Implicit Type conversion
A very powerful construct of WPF are implicit type converters.
They do their work silently in the background. When you declare a BorderBrush, the word "Blue" is only a string.
The implicit BrushConverter makes a System.Windows.Media.Brushes.Blue out of it.
The same regards to the border thickness that is beeing converted implicit into a Thickness object.
WPF includes a lot of type converters for built-in classes, but you can also write type converters for your own classses.
Syntax:
<Border BorderBrush="Blue" BorderThickness="0,10">
</Border>

Markup Extensions
Markup extensions are dynamic placeholders for attribute values in XAML.
They resolve the value of a property at runtime.
Markup extensions are surrouded by curly braces
(Example: Background="{StaticResource NormalBackgroundBrush}").
WPF has some built-in markup extensions, but you can write your own, by deriving from MarkupExtension.
These are the built-in markup extensions:
Binding
To bind the values of two properties together.
StaticResource
One time lookup of a resource entry
DynamicResource
Auto updating lookup of a resource entry
TemplateBinding
To bind a property of a control template to a dependency property of the control
x:Static
Resolve the value of a static property.
x:Null
Return null
Syntax
<TextBox x:Name="textBox"/>
<Label Content="{Binding Text, ElementName=textBox}"/>

Namespaces
At the beginning of every XAML file you need to include two namespaces.
The first is http://schemas.microsoft.com/winfx/2006/xaml/presentation. It is mapped to all wpf controls in System.Windows.Controls.
The second is http://schemas.microsoft.com/winfx/2006/xaml it is mapped to System.Windows.Markup that defines the XAML keywords.
The mapping between an XML namespace and a CLR namespace is done by the XmlnsDefinition attribute at assembly level. You can also directly include a CLR namespace in XAML by using the clr-namespace: prefix.
Syntax:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</Window>

Disable UAC

                As most have found out if you disable the UAC (User Account Controls) the desk top gadgets don't work. I found the registy edit that lets you disable UAC and keep the desktop gadgets. I did reboot to see if it works and it does!

using Registry Editor

1. Open Registry Editor (regedit.exe)
2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sidebar\Settings
3. Create a new DWORD Value called AllowElevatedProcess
4. Set the value of the new DWORD to 1
5. Close the registry editor. Your gadgets should work now. No reboot or anything necessary.

using Command Line

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f


Code Sign Vs SSL Certificate

Basically, a code-signing cert gives you a private key that can be verified against a public key certified by a known authority. You make a digital signature with that key, and the other end can verify you had a cert from a trusted source when you signed it.

An SSL cert is just a signed "document" that can be verified as coming from a trusted source. You can't encrypt or sign with it because it doesn't have any key material that's yours alone; it's just a signed document saying "I certify that I trust who this guy says he is."

n SSL Certificate is used for authentication of your website/application server.
A Code Signing Certificate is used for integrity/authentication of the exe,dll,... you deliver.

Get Connectionstring from app.config

Get Connectionstring from app.config



<connectionStrings>
    <add name="myConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />
  </connectionStrings>

Output

 string connStr = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
            MessageBox.Show(connStr);

Get User settings

Get User settings

Input
<userSettings>
        <TestSetting.Properties.Settings>
            <setting name="CompanyName" serializeAs="String">
                <value>Gantec</value>
            </setting>
        </TestSetting.Properties.Settings>
    </userSettings>

Output
MessageBox.Show(Properties.Settings.Default.CompanyName);

Get AppSettings.config File in C#.net

Get AppSettings.config File


Input


<configuration>
  <appSettings>
    <add key="ShowQuery" value="true"/>
  </appSettings>
</configuration>

Output

ConfigurationManager.AppSettings["ShowQuery"];

Prevent Multiple Instance Running

Prevent Multiple Instance Running

In Program.cs file add the below code.
 static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Process[] process = Process.GetProcessesByName(Application.ProductName); //Prevent multiple instance
if (process.Length > 1)
{
MessageBox.Show("{Application Name}  is already running. This instance will now close.", "{Application Name}",
MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
else
{
Application.Run(new <Initial Form>());
}
}

Visual Studio 2013 New Features

Visual Studio 2013 New Features

  • Roaming Settings
  • CodeMap – Visual Debugging
  • Peek Definition – Alt+F12
  • Code Lens
  • New Blue Theme
  • UI Icons
  • Feedback & Notifications
  • Enhanced Scrollbar
  • Navigate To (Ctrl+,)
  • Auto Brace Complete
  • Move Line Up/ Down (Alt Arrow-Up/ Arrow-Down)
  • Minor Tweaks

Using Overloading method via Interface in C#.Net

Here the Example for Using Overloading method via Interface in C#.Net

Interface Name: IFamily
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    interface IFamily
    {
        string DisplayName(string str);
    }
}
Interface Name: IFamilyMember
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    interface IFamilyMembers
    {
        string DisplayFamilyMembers(string str);
        string DisplayName();

    }
}
ClassName: ClsFamily
Interface Name(s):IFamily ,IFamilyMembers
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    class ClsFamily :IFamily ,IFamilyMembers
    {
        public string DisplayName(string str)
        {
            return str;
        }
        public string DisplayFamilyMembers(string str)
        {
            return str;
        }
        public string DisplayName()
        {
            return "Good";
        }
    }
}
Class Declaration and Call Methods
  ClsFamily obj = new ClsFamily();
   MessageBox.Show(obj.DisplayName("Naraayanan"));
   MessageBox.Show(obj.DisplayFamilyMembers("Naraayanan"));            MessageBox.Show(obj.DisplayName());