Skip to main content

Posts

Showing posts from March, 2012

How to use IEnumerable/IEnumerator

IEnumerable is an interface, implemented by System.Collecetion type in .Net that provides iterator pattern. The definition according to MSDN is:

"Exposes the enumerator, which supports simple iteration over non-generic collection."

It's something that you can loop over. That might be a List or Array or anything else that supports foreach loop.

IEnumerator allows you to iterate over List or array, and processes each element one by one
Read More...

Define your own Collection class that support Iterator Pattern

Today we will demonstrate how these interfaces works. For that we 'll develop our own classes that implement these interfaces.

Objective

Define Enumerable and Enumerator object for User Define data type (i.e. Class)

Using the code

First of all let's define a class for which we are going to developed Iteratorclasses. Here is a class for same.
Read More...

Understanding Protected, Internal and Protected Internal Access modifiers in OOPs

We all know access modifiers are said to be 'Back-bone of OOPs '.Which seems to be very easy to remember (for interview purposes) but at the same time much difficult to show and understand by an example to someone when asked by anyone (at least for me J)

I digged-into it one fine Saturday morning and felt very happy to understand  all of them. Here I tried to show the behavior of three most important but 'confusing' Access Modifiers in C# .

1.       Protected(P)
2.       Internal(I)
3.       Protected Internal(PI)
Read More...

What is the use of "VAR" keyword in c#?

"Var" Keyword = Var keyword is an implicit way of defining DataTypes. Implicit means indirect way of defining variable types.

In simple words by looking the data at the right hands side the left hands side data types is defined by the compiler during the generation of the "IL" code.

Let me show a simple example what does implicit (indirect) way of defining DataTypes means.
Read More...

Check If App Is Running On An iPad

To check if your app is running on an iPad, there is a much easier way.

Check the userInterfaceIdiom property of the device to get the information you need:
-(BOOL)isDeviceiPad {BOOL iPadDevice =NO;   // Is userInterfaceIdiom available?if([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]){// Is device an iPad?if([[UIDevice currentDevice] userInterfaceIdiom]== UIUserInterfaceIdiomPad) iPadDevice =YES; }return iPadDevice; } As noted in the comments below, Apple provides a macro to accomplish the same task. Here is the full definition from the UIDevice.h header file:
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone) Thanks for the heads up on this.

How to use IEnumerable/IEnumerator

IEnumerable is an interface, implemented by System.Collecetion type in .Net that provides iterator pattern. The definition according to MSDN is:

"Exposes the enumerator, which supports simple iteration over non-generic collection."

It's something that you can loop over. That might be a List or Array or anything else that supports foreach loop.

IEnumerator allows you to iterate over List or array, and processes each element one by one
Read More...

Porting a Silverlight App to a Metro-Style App

Windows 8, which was introduced at the Microsoft BUILD conference last year, is an exciting new OS that introduced a new UI as well as a new runtime: Windows Runtime, called WinRT. It's the backbone of the new Metro experience in Windows 8. Like many others, I've been playing with Windows 8 and kept hearing that Silverlight skills can be reused in Metro-style applications. I decided to find out for myself by taking a Silverlight 2 project and seeing how easy it was to port to a Windows 8 Metro application using C#/XAML.

Read More from: Original Source

Learn WP7Dev in 31 Days – Day 31 – Deploying the application to the WP7 Market place

This is the final article in this 31 day series on Learning Windows Phone 7 Development from the scratch, here in this article we are going to see how to deploy the application to the market place. Windows Phone Market Place is a portal where we need to publish the applications developed using the Windows Phone SDK and making it available to the public for download. Windows Phone Market is a one stop portal where users can purchase apps or games using the credit cards or free applications with ease and provide the reviews to the applications that are very helpful.

Microsoft Windows Phone Marketplace can be access using the link https://windowsphone.create.msdn.com. As a developer we need to register with the market place to publish our application for download. For registration Microsoft provides options for Students, Developers and Business to register as per their requirement with some nominal fees per year of registration.

Read More from: Original Source

xCode 4 Tips : Option Key directs open action to Assistant editor + Direct Open

xCode 4 Tips :  Option Key directs open action to Assistant editor + Direct Open
Holding down the option key whilst performing an action that will open/show a view in the editor will put that view into the Assistant editor.  Examples:

option + click on a file in the Project Navigator
option + select the "Open" button in the File Open dialog
option + select the "Open" button in the Open Quickly dialog (Cmd-shift+O to get this dialog).
option + cmd + click on any clickable symbol in source view (method, class, file name, instance var name, most type names, etc)
option + click on the .h file listed in the documentation pop-over (option click on a symbol in editor to get this).
option + click on a file listed in Search navigator, Breakpoints navigator, Log navigator, etc.
option + select a file you navigated to in the jump bar of the main editor.

and so on.  You get the idea.  Very nice Xcode 4 feature.

OOOOH, bonus tip(s)!

You can have more than one assistant editor.  The "…

Treat Warnings as Errors

It's good to keep things clean from the start, whether you are running a simple test, writing a large scale enterprise app or building anything in between. With that in mind, I highly recommend you always configure project settings so the compiler treats warnings as errors – in other words, a warning will result in the same output as an error, no executable created.
Read More...

What is Data Type in c#.

In this Article we are going to learn about Data Types in C#

What is Data Type?

The type of data that a variable contains is called Data Type (type). A Data Type is a classification of things that share similar type of qualities or characteristics or behavior.

C# is strongly typed language so every variable and object must have a type.

There are two types of data type in C#

  1.   primitive types (or) predefined

Ex:  byte, short, int, float, double, long ,char, bool, DateTime, string, object etc..

 2.   non-primitive types (or) User Defined

Ex: class , struct , enum , interface,  delegate, array.

In C#, based on what a variable contains there is two types of built-in data type
Read More...

what are the benefit of Stored procedure ?

What are the benefit of Stored procedure ?

1) Improved Performance : Database can optimize the data access plan used by procedure and cache it for subsequent reuse. 

2) Security : Stored proceudre can be individually secured within the database. A client can be granted permissions to execute SP without having any permission on the underlying tables. 

3) Easy to maintain : easier to modify a stored procedure than it is to change a hard-coded sql statement. 

4) Reduce network traffice : Sql statement can be executed in batches rather than sending multiple requests from the client

How to use the ui action script in iPhone

This tutorial is use to show the use of the Action Script .


1.  Open the xcode & choose "File->New Project".

2.  Select "View Based Application" from left menu .

3.  Name your project as "ActionSheet" and save the project.

4.  Then  select "ActionSheetViewController.h" file from the left side menu or group and files. Then enter the following :

#import <UIKit/UIKit.h>


@interface ActionSheetViewController : UIViewController<UIActionSheetDelegate> {


IBOutlet UILabel *label;

}



@property (nonatomic,retain) UILabel *label;

-(IBAction)showActionSheet:(id)sender;


@end




5. Then  select "ActionSheetViewController.m" file from the left side menu or group and files.

#import "ActionSheetViewController.h"


@implementation ActionSheetViewController

@synthesize label;



-(IBAction)showActionSheet:(id)sender {

    UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Action Sheet" delegate:selfcancelButtonTitle:@"Can…

My App Crashed, Now What? – Part 2

The first part of the tutorial introduced SIGABRT and EXC_BAD_ACCESS errors, and illustrated some strategies for resolving them using the Xcode debugger and Exception Breakpoints.

But our app's still got some problems! It doesn't work exactly as it should, and there are plenty of crashes still lurking.

Fortunately, there are still more techniques you can learn to handle these problems that we'll cover in this second and final part of this tutorial series.

So without further ado, let's get right back to fixing this buggy app!
Read More at....

My App Crashed, Now What? – Part 1

Fixing crashes doesn't need to be hard. You're likely to worsen the situation if you freak out and start changing things at random, hoping the bug will magically go away if only you utter the right incantations. Instead, you need to take a methodical approach and learn how to reason your way through a crash.

The first order of business is to find out where exactly in your code the crash occurred: in which file and on which line. The Xcode debugger will help you with this, but you need to understand how to make the best use of it, and that's exactly what this tutorial will show you!

This tutorial is for all developers, from beginning to advanced. Even if you're an experienced iOS developer, you'll probably pick up some tips and tricks along the way you didn't know about!
Read More at...

Complete Generic MVVM in Silverlight Part III

This is part 3 of the series in MVVM, in this part of the series; I will look at the ViewModel and provide you will examples that might help you to understand better. The ViewModel is the heart of MVVM. This is where everything is happening.

Introduction 

This is part 3 of the series in MVVM, in this part of the series; I will look at the ViewModel and provide you will examples that might help you to understand better. The ViewModel is the heart of MVVM. This is where everything is happening.
Read More...

Complete Generic MVVM in Silverlight Part II

In the first part of this series I outlined the basic information that you will need to know to get started with MVVM. In this part of the serials I will demonstrate to you how to create a Visual studio structure of MVVM without using any toolkit to help you. After the Structure is in place we will create our model.

Introduction

In the first part of this series I outlined the basic information that you will need to know to get started with MVVM. In this part of the serials I will demonstrate to you how to create a Visual studio structure of MVVM without using any toolkit to help you. After the Structure is in place we will create our model.  
Read More...

Complete Generic MVVM in Silverlight Part 1

Almost everyone doing development in Silverlight is talking about MVVM. This is the part 1 on the subject. I decided to split the articles into different parts as this tends to be a confusing subject for the beginners in the subject. What is good about this article is that I will cover the basics of MVVM and give you a full explanation on how you can retrieve, Edit, add, Update and delete data in MVVM and this is the only article I have seen so far that can do that. Another great thing about this article is that we are not going to use any Toolkit to enforce the rules of MVVM, So this is a Generic MVVM Article, you don't need to install anything or download anything to follow this article.

Introduction 

Almost everyone doing development in Silverlight is talking about MVVM. This is the part 1 on the subject. I decided to split the articles into different parts as this tends to be a confusing subject for the beginners in the subject. What is good about this article is that I will cov…

Introducing Expression Blend for Visual Studio Part 1

Just what is Expression Blend for Visual Studio ? Why is Expression Blend now a Visual Studio product ? Well as most folks familiar with Windows development know, the process is not just about the programmer but it is also about incorporating good design for your user. About six years ago Microsoft Expression Blend was introduced as a what you see is what you get interface design tool and versions of this program have appeared to support not just WPF (Windows Presentation Foundation) tools but also support platforms as Silverlight (for .NET web browser based applications), Phone 7, and Sketchflow prototyping. All of these tools (while containing it's own code editor) always allowed you to integrate directly with the Visual Studio code IDE (Integrated Development Environment).

Read More from: Original Source
[Visual Studio] [Expression Blend] [Window 8]

A Resource Hacker in C# .NET

In this article I'm going to get into a .NET DLL file and extract its types, show their information, extract the members of each type, and even invoke them!!! Yes, a useful and complete Resource Hacker. All of these are done by making use of theSystem.Reflection namespace. To better understand this application, I suggest that you get yourself familiarized with the concept of Reflection and theSystem.Reflection namespace itself. The Microsoft MSDN would be a nice resource. There is also a complete Windows Forms application for the sake of understanding this better. Enough with all this and let's get our hands dirty.

Please note that these objects are declared globally within the main form as we will be using them a lot:
Read More...

Best iOS development learning resources

Hangman - a simple word game for WP7

This is a very simple game where, usually, a user is given with a word to guess. A user has typically 7-8 chances to guess the word. For each missed chance, a portion of the hanging of a man is drawn as shown above in the picture. The basic requirements of this game are very simple:

1. User should be able to select the difficulty level

2. User should be able to guess a letter by typing (or tapping on a keyboard button) on the Windows Phone

3. Keeping track of scores and to save/reload settings upon exiting/entering the game

4. Able to generate the word based on the difficulty level

Read More from: Original Source

Send Mail using WebService

Sending mail is an easy task, using web-service has added some additional flavor to it.What i mean to say is if you know how to use a web-service it is not confined to web application only rather a windows form, applications like c++,java,vb programs can also consume the same web-service to send mail.
Read More....

EventKit Framework for iPhone Calendar

Introduction

Accessing iPhone native calendar from the appliation and add a custom event to the calendar along with reminder alert.

How to use?

First add Event Kit Framework to you application. The Event Kit framework provides classes for accessing and modifying calendar event information.


NSString *str=@"This is Your Event title";

EKEventStore *eventStore = [[EKEventStore alloc] init];

EKEvent *event = [EKEvent eventWithEventStore:eventStore];

event.title = str;

event.startDate = [[NSDate alloc] initWithTimeInterval:timeint sinceDate:date];
This is startdate and time of the event we can set by using date time fucntions to calulate and set this.

event.endDate = [[NSDate alloc] initWithTimeInterval:1800 sinceDate:event.startDate];
Similarly this is event's end date and time

NSTimeInterval interval = 60* -min;
This is the time at which you can see the native calendar alert. Note that here i write (-min) this indicates that alert will show before event time otherwise it will appear afte…

How convert List to Datatable in c#?

How convert List to Datatable in c#?

public DataTable LINQToDataTable<T>(IEnumerable<T> varlist)
        {
            DataTable dtReturn = new DataTable();

            // column names
            PropertyInfo[] oProps = null;

            if (varlist == null) return dtReturn;

            foreach (T rec in varlist)
            {
                // Use reflection to get property names, to create table, Only first time, others

                if (oProps == null)
                {
                    oProps = ((Type)rec.GetType()).GetProperties();
                    foreach (PropertyInfo pi in oProps)
                    {
                        Type colType = pi.PropertyType;

                        if ((colType.IsGenericType) && (colType.GetGenericTypeDefinition()
                        == typeof(Nullable<>)))
                        {
                            colType = colType.GetGenericArguments()[0];
                        }

                        dtReturn.Columns.Add(…

Understanding ASP.NET Roles and Membership - A Beginner's Tutorial

How many sites have you seen that requires you to login? I guess the answer to this question is "almost all of them". Well, the idea behind this article is to understand how ASP.NET lets us create sites with an authentication and authorization mechanism in place and how we can use ASP.NET server controls to quickly and efficiently implement this.

Background

When we are working on applications where authentication and authorization is a key requirement, then we will find the ASP.NET roles and membership feature very useful. Authentication means validating users. In this step, we verify user credentials to check whether the person tying to log in is the right one or not. Authorization on the other hand is keeping track of what the current user is allowed to see and what should be hidden from him. It is more like keeping a register to what to show and what not to show to the user.

Whenever a user logs in, he will have to authenticate himself with his credentials. Once he is authen…

Silverlight Pivot View Control – Part 1

Just before one month from now, I worked with a new company; I really loved my new Job. New experience taken from Michael Ruddick; He is a Chief architect in T-Force.

I will not forget to talk about Tareq Amin "The Vise president in T-Force". He is a big fan of the new Metro Apps style; Yeah Metro is amazing.

Tareq is listening to me a lot, sharing Ideas, respecting people.
Also he is studying to make Google's 80/20 Innovation Model part of our work; or maybe to do like Innvoation Center in Amman Office; That's really coool!

Read More from: Original Source

Silverlight navigation: get rid of the view-model-locator

I'm building a sample application for a friend in order to see if it is possible to have a completely OOB and offline Silverlight application running on a Mac using a document database (RavenDB in this case, a special version) as backend.

On the other side I'm using the same spike to start the Radical Presentation Silverlight 5 implementation, if you recall the first time we spoke about it we state that the main pillar should be simplicity.

Simplicity, IMHO, means also friction-less and friction-less in a Silverlight application, for example, can be translated to "navigation application" that uses all the out-of-the-box services provided by the Silverlight infrastructure such as the navigation framework.


Read More from: Original Source

A Radial Gauge custom control for Windows8 Metro

A long time ago in a galaxy actually not so far away, Colin Eberhardt wrote a Radial Gauge custom control for Silverlight in less than six hours. It had everything a gauge should have: a needle, and a scale with tick markers and labels. Hell, it even had colored quality range indicators. A couple of months ago, I thought "Hey, I can do that too." So I started a new Metro project in my Developer Preview of Windows 8. I tried to create a Metro version of that same radial gauge in less than six hours. Six lonely nights later, I still had absolutely nothing, and I started to consider anger management training. I gave up and started from scratch, this time on a much simpler control: a minimalistic slider. That involved a lot of work with -let's be honest- a rather lame result. The Developer Preview was clearly not an ideal environment for building custom controls.

Read More from: Original Source

Portable Class Library and ICommand

A while ago I wrote an article describing how the Portable Class Library can enable us to write Unit Tests for our Windows Phone apps using the tools and frameworks we're already familiar with. By adding an abstraction layer and using types common to the Base Class Library, Portable Class Library and Windows Phone we can write unit tests using tools like MSTest and Moq.

Read More from: Original Source

WCF Introduction

WCF stands for Windows Communication Foundation. Basically WCF is a platform for building, configuring and deploying distributed services. In fact we can say wcf is a service layer that will allows us to create and communicate using verities of ways. 

Before WCF: Previously we used to use web services. The major problem with web service is that only http binding is allowed with it (No interoperability), exception handling mechanism was not robust and few more disadvantages.Because of all these drawbacks WCF took birth and came into picture by overcoming these drawbacks. Therefore we can say WCF as next generation of web services. 

Read More...

Incremental Validation in WPF

How do you ensure that developers using your business objects also incorporate the necessary validation code to guarantee that only good data is passed to your class' property? I've looked at the three interfaces that allow you to incorporate validation code into your class while integrating with an application's user interface, and Data Annotations which allow you to separate your validation code from your class. WPF includes another option that allows developers to incrementally add validation rules to their UIs.

Read More from: Original Source

About Prompt in WP7 via WCF Service

Firstly before we get to start working with Toast prompt, We need to download Coding4Fun Toolkit from Here. Later add Coding4Fun.Phone.Controls.dll as a reference for our newly created project.

Today, in this article let's learn another new concept related to window phone 7, whereby communicating with WCF Service to perform some operation.


Read More from: Original Source

A financial dashboard designer based on Telerik RadDiagram

The new RadDiagram framework brings, together with a host of new exciting things in Telerik's 2012 Q1 release, a new world of possibilities to the WPF and Silverlight community. This article attempts to show you that Telerik's RadDiagram is easy-to-use and that it differs from other Telerik controls in that it more closely represents a framework than a control. It's an invitation to augment and customize the RadDiagram toolset in function of your application and business context. That said, we have to tell you straight away that RadDiagram, as released with Q1, is just the beginning. We have at this point put down the foundations for lots of exciting things to come and you can expect to see this RadDiagram branch off in various directions in coming releases. Great care and much energy were put in making it a flexible, robust, and broad framework for future developments. We have tried to make your (and our) task of customizing things easy while retaining the possibility to …

Microsoft .NET Frameworks features details

This article describes the features and enhancements that has happened with respect to Microsoft .NET Frameworks

Microsoft .NET Frameworks....


Features and enhancements that has happened with respect to Microsoft .NET Frameworks

Objective


To know the series of events happened with respect to .NET framework.

Microsoft .NET Framework Details

Features: .NET Framework Version - V1.0/1.1: Released in Year 2002/2003

CLR 1.0/1.1
C#.NET was introduced
Upgraded to VB.NET from VB 6
Upgraded to ASP.NET from ASP 3
Upgraded to ADO.NET from ADO
Remoting (previously DCOM) was introduced
Web Services introduced
Visual Studio Versions:  2002/2003

Features: NET Framework Version - V 2.0: Released in Year/2005

CLR 2.0
C#/VB/ASP/ADO.NET 2.0
Web Services Enhancements (WSE)
ASP.NET AJAX
Visual Studio Versions:  2005

Features: NET Framework Version - V 3.0: Released in Year/2006

CLR 2.0
C#/VB/ASP/ADO.NET 2.0
Windows Presentation Foundation (WPF) introduced
Windows Communication Foundation (WCF) introduced
Windows Workflow Founda…

Porting a #Silverlight App to a Metro-Style App

Windows 8, which was introduced at the Microsoft BUILD conference last year, is an exciting new OS that introduced a new UI as well as a new runtime: Windows Runtime, called WinRT. It's the backbone of the new Metro experience in Windows 8. Like many others, I've been playing with Windows 8 and kept hearing that Silverlight skills can be reused in Metro-style applications. I decided to find out for myself by taking a Silverlight 2 project and seeing how easy it was to port to a Windows 8 Metro application using C#/XAML.

Read More from: Original Source  

Xcode 4.x tip – how to get a separate working debugger window

Just figured this out today after trying once before.  If you have a multi-monitor setup like I do you may like to have the console & debugger be in a separate window.  Xcode 4 moved to a predominately single window interface which is a bummer for multi-monitor setups.  I tried opening a new window and [...]
Read more of this post

Download Visual Studio 11 Beta (Standalone/Offline Installer)

Visual Studio 11 comes in four flavors called Ultimate (Visual Studio 11 Ultimate Beta is the comprehensive ALM offering for organizations developing and operating highly scalable software applications and services), Premium (Visual Studio 11 Premium Beta offers an integrated ALM solution to bring together stakeholders, users, and software development functions to deliver compelling applications as a unified team), Professional (Visual Studio 11 Professional Beta is a unified development experience that enables developers to create multi-tier applications across the web, cloud, and devices) andTest Professional (Visual Studio 11 Test Professional Beta is ideal for testers, business analysts, product managers, and other stakeholders who need team collaboration tools, but not a full development IDE).

Here is the direct downloadable links for Visual Studio 11 Beta web installer:

Visual Studio 11 Ultimate Beta (Web Installer)Visual Studio 11 Premium Beta (Web Installer)Visual Studio 11 Prof…