This c# and c# net site aims to provide book reviews and free ebook on c# datagrid, c# array, c# xml, msdn c#, c# application, c# example, c# form, c# sample, c# programming, asp net c#,c# database, c# console, c# library, c# file, c# enum, c# switch and c# code, etc.
Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

C# Development - C# Yellow Book

C# Development - C# Yellow Book is written by Rob Miles, Department of Computer Science, University of Hull. This C# book starts with introduction to computers, programming, first look at C# and finally ends with program organization and debugging.
Following are the topics covered in this C# ebook.
  1. Computers - an introduction
  2. Programming Languages - an introduction
  3. C# a look
  4. A First C# Program
  5. Manipulating Data in C#
  6. Writing a Program
  7. C# Methods
  8. C# Arrays
  9. C# Switching
  10. Our Case Study: Friendly Bank
  11. C# Enumerated Types
  12. C# Structures
  13. C# Objects, Structures and References
  14. C# Designing With Objects
  15. Static Items
  16. The Construction of Objects
  17. From Object to Component
  18. C# Inheritance
  19. Object Etiquette
  20. The power of strings and chars
  21. Properties
  22. Building a Bank
  23. Storing Business Objects
  24. Business Objects and Editing
  25. A Graphical User Interface
  26. Using Delegates
  27. Structured Error Handling
  28. Program Organization
  29. Debugging
  30. Glossary of Terms
You can download or read this C# programming ebook from the following link.
Read More/Download
Related C# and .Net books
  1. Free C# ebooks
  2. C# and ADO.Net books
  3. Online C# articles, books and materials
  4. VB.Net, .Net framework, ASP.Net ebooks and materials
Buy C#.Net books
  1. Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition (Books for Professionals by Professionals)
  2. More Effective C#: 50 Specific Ways to Improve Your C# (Effective Software Development Series)
  3. Expert C# 2008 Business Objects

Free C# Ebooks Download

You know C# is a powerful (OOP) object-oriented programming language developed by Microsoft. Moreover C# is the programming language that most directly reflects the underlying Common Language Infrastructure (CLI). C# 3.0 is the comming version of the language developed by Microsoft.
This post provides you free C# ebooks download. This free c# pdf ebooks and online version of ebooks help you to study C#.net, c# net interview questions, c# net training, c# net programming, c# net class, c# net 3.0, c# net dataset, c# net web service, datagrid in c# net, c# net database, c# net ftp, c# net compact framework, c# net examples, c# net treeview, c# net sql, c#
console, c# library, c# file, c# enum, c# switch and c# code,etc
You can get free C# ebooks and tutorials by visiting following C# ebook links.

  1. A Comparison of Microsoft's C# programming language to Sun Microsystem's Java Programming Language By Dare Obasanjo
  2. A Comprehensive Guide to C# and the .NET Platform by Andrew Troelsen
  3. A Programmer’s Introduction to C#, Second Edition By Eric Gunnerson
  4. ASP.Net With C# - The Basics By Vijay Mukhi, Sonal Mukhi and Neha Kotecha
  5. Basic C# exposure
  6. C# - The Basics By Vijay Mukhi and Sonal Mukhi
  7. C# .NET Web Developer’s Guide By Adrian Turtsch, DotThatCom.com, Jason Werry, Greg Hack and Joseph Albahari
  8. C# :Your Visual Blue Print for Building .Net Applications By Eric Butow and Tommy Ryan
  9. C# Classes - Threads, Winforms and XML By Vijay Mukhi, Vinay Kalantri and Sonal Mukhi
  10. C# Faq For C++ Programmers By Andy McMullan
  11. C# in Detail By Jon Jagger
  12. C# Language Reference By Anders Hejlsberg and Scott Wiltamuth
  13. C# to Microsoft's IL By Vijay Mukhi
  14. C# Tutorial Contents
  15. Data Structures and Algorithms with Object-Oriented Design Patterns in C# By Bruno R. Preiss
  16. Dissecting a C# Application: Inside SharpDevelop
  17. Draft C# Language Specification
  18. Fascinating concepts about C# classes
  19. Programmer's Heaven C# School Book By Faraz Rasheed
  20. Sams Teach Yourself C# in 24 Hours By James Foxall and Wendy Haro-Chun
  21. User Interfaces in C#: Windows Forms and Custom Controls By Matthew Macdonald
  22. Visual Studio.NET with C# By Vijay Mukhi, Suraj Godhwani, Sonal Mukhi

C# to Microsoft's IL

By Vijay Mukhi
The .NET languages are growing more pervasive by each passing day. We, therefore decided to explore the world of Intermediate Language (IL), a language to which all the source code written in various languages such as C#, COBOL etc. get compiled. IL represents the transient stage in the process of conversion of source code into machine language. It is inescapably imperative to gain mastery over IL, because knowledge of IL translates into competence over IL code that may have originally been written in any programming language. Thus, it provides a common platform to all the programming languages. Realising its importance in the scheme of things in the .NET world, we decided to get under the skin of IL and unravel its mysteries.
IL puts an end to the unending dissidence amongst programmers with regard to the superiority of one programming language over the others. To this end, IL is a great leveller. It is also a stupendous facilitator because, in the .NET world, one part of the code may have been written in COBOL, while another may have been written in C#, but it all eventually gets converted into IL. This provides great freedom and flexibility to a programmer to select the language he/she is most familiar with and does away with the need to constantly retrain oneslf to learn new languages that seem to crop up every other day.
Our modus operandi has been to strip the sheen of complexity surrounding IL by presenting complex concepts in a simple and comprehensible manner. These concepts have been corroborated with lucid examples. We have put into service all the powers of clairvoyance at our disposal to discover and illustrate concepts of IL, that are not readily discernible to the layman.
To facilitate the understanding of the sample programs, in every example, we have first presented the source code of the programs in the C# language, and then, we have offered their equivalent IL code. Thereafter, we have applied reverse engineering to fathom the IL code by unravelling the equivalent C# code. We have demonstrated how, in some cases, IL transcends the limitations of conventional programming languages; while in others, it falls awfully short of expectations. Though we don't expect undue approbation, it would not be immodest to mention that, while working with the Beta version of IL, we have unearthed many undocumented features and lacunae, which we have highlighted in the book for your benefit.
To conclude, it can be stated that the aim of this book is to explain the various nuances of IL and to make you adept at understanding IL code. It is also our desire to alleviate your fear of lower level languages. The lure of IL lies in its simplicity coupled with its tremendous power, which makes an intoxicating cocktail. But, don't be beguiled by the apparant simplicity of the examples. We don't expect an acquiescent attitude from you. Instead, we implore you to try out all the examples by yourelf and ascertain their outcome. Thus, don't stand ruminating at the brink of this exciting sea of knowledge. Dive right in! We assure you that you shall come out a winner at the end of this sojourn into the world of IL

C# Faq For C++ Programmers

By Andy McMullan
The C# FAQ for C++ programmers was first posted in Aug 2000, and is regularly updated. It answers many of the questions that C++ developers have when they first encounter C#. I recommend that you read the .NET Framework FAQ before reading this one.
What is C#?
C# is a programming language designed by Microsoft. It is loosely based on C/C++, and bears a striking similarity to Java. Microsoft describe C# as follows:
"C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced 'C sharp') is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++."
How do I develop C# apps?
The (free) .NET SDK contains the C# command-line compiler (csc.exe). Visual Studio has fully integrated support for C# development. On Linux you can use Mono.
Does C# replace C++?
There are three options open to the Windows developer from a C++ background:
  • Stick with standard C++. Don't use .NET at all.
  • Use C++ with .NET. Microsoft supply a .NET C++ compiler that produces IL rather than machine code. However to make full use of the .NET environment (e.g. garbage collection), a set of extensions are required to standard C++. In .NET 1.x this extended language is called Managed Extensions for C++. In .NET 2.0 ME C++ has been completely redesigned under the stewardship of Stan Lippman, and renamed C++/CLI.
  • Forget C++ and use C#.

Each of these options has merits, depending on the developer and the application. For my own part, I intend to use C# where possible, falling back to C++ only where necessary. ME C++ (soon to be C++/CLI) is very useful for interop between new .NET code and old C++ code - simply write a managed wrapper class using ME C++, then use the managed class from C#. From experience, this works well.

Click to Read More

C# .NET Web Developer’s Guide

By Adrian Turtsch, DotThatCom.com, Jason Werry, Greg Hack and Joseph Albahari
For many years, C and C++ programmers have been searching for alternative programming languages that offer the same kind of flexibility and power of C and C++, but without the complexities and steep learning curve required for mastery of the language.What many programmers desired was a language that would allow applications to be built rapidly, but at the same time giving them the ability to code at low level.The search has finally ended with Microsoft’s new language—C#, a member of the .NET Framework.
C# is the revolutionary new language from Microsoft, designed solely to run on the .NET framework. Drawing experiences from C, C++, and Visual Basic, C# was designed to be a simple and modern object oriented programming language.
But why learn C#? With the integration of C# and the Visual Studio.NET (known as Visual C#), developing Windows and Web applications has been radically simplified.With full access to the .NET Class Libraries, C# includes built-in support for developing robust Web services and ASP.NET applications. (It was reportedly said that Visual Studio.NET was built entirely using C# and that most of the examples in MSDN were coded in C#.That in and of itself is a very good reason to learn C#!) Besides this, C# enhances the productivity of programmers by eliminating common errors often associated with C and C++.
While many of the earlier C# books have primarily focused on the language syntax, The C# .NET Web Developer’s Guide illustrates the uses of C# for Web developers looking to harness the new functionality and ease of this powerful programming language.The best way to learn a new language is by trying out the examples while you are reading this book.Within many chapters, you will find numerous code examples used in various practical situations; this hands-on, code-intensive approach allows you to have a deeper understanding of issues involved in C# Web development, and at the same time allows you to cut and paste portions of applicable code into your current projects, thereby shortening development time.
We are constantly working hard to produce the best technical books needed by professional programmers like you. I sincerely hope you will enjoy reading this book as much as the authors did writing it!

C# Language Reference

By Anders Hejlsberg and Scott Wiltamuth
C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced “C sharp”) is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++.
C# is provided as part of Microsoft Visual Studio 7.0. In addition to C#, Visual Studio supports Visual Basic, Visual C++, and the scripting languages VBScript and JScript. All of these languages provide access to the Microsoft .NET platform, which includes a common execution engine and a rich class library. The Microsoft .NET platform defines a "Common Language Subset" (CLS), a sort of lingua franca that ensures seamless interoperability between CLS-compliant languages and class libraries. For C# developers, this means that even though C# is a new language, it has complete access to the same rich class libraries that are used by seasoned tools such as Visual Basic and Visual C++. C# itself does not include a class library.
The rest of this chapter describes the essential features of the language. While later chapters describe rules and exceptions in a detail-oriented and sometimes mathematical manner, this chapter strives for clarity and brevity at the expense of completeness. The intent is to provide the reader with an introduction to the language that will facilitate the writing of early programs and the reading of later chapters.
Click to Download

Visual Studio.NET with C#

By Vijay Mukhi, Suraj Godhwani, Sonal Mukhi
This book on Visual Studio.Net is a trailblazer, since it is extremely innovative in its approach. It is a screen-based book, which suggests that the entire book is packed with screens, making it very easy and intuitive for a reader to grasp the explanations accompanying them. It makes for an interesting reading, and also does away with the requirement of sitting in front of a computer while reading this book.
Visual Studio.Net facilitates a paradigm shift in the programming world. It has alleviated the task of software development considerably, by synthesizing all applications into a single product. Earlier, every product had its own User Interface, and programmers had very strong loyalties towards specific products. This prevented their smooth migration from existing products to the newer products, which emerged with systematic regularity.
In the Visual Studio.Net environment, building complex applications is a breeze. The switch over from one runtime to another, is also considerably smooth and effortless.
During our perambulation through the various facets of this fascinating product, we have adopted a 'step-by-step' approach to unravel the various features. We have pared down the irrelevant details, and converged only on the most pertinent areas. We have systematically built-up on own our earlier explanations incrementally. For instance, after ensuring that the reader is comfortable with building various types of applications, we have graduated onto the topic of deployment, so that the reader can then, transport his application with ease.
Readers are well advised to peruse the text thoroughly, enter the code as demonstrated, and run the applications, to get a hands-on experience of the product. This is the best available approach to master this product.
For those with an insatiable appetite for technical knowledge, we have exhumed the surface, in order to disinter and explore the workings of the C# language. The latter chapters expound the C# code, generated by the framework for applications built in the earlier chapters.
The three-pronged novel approach of firstly, adding visual appeal by incorporating a plenitude of screens, secondly, of providing simple and complex applications to illustrate various concepts, and finally, of going behind the scenes to explore the c++ code generated by the application, is the linchpin of this book.
We have persevered to simplify the preplanning concepts and have percolated the grain from the chaff. The perspicacity of the text is an important feature implemented by us.
This book contains a plethora of information about Visual Studio.Net and the C# language. We have focussed our attention on Visual Studio.Net, since it is going to play an increasingly important role in the field of computer programming, and its ramifications are going to be far-reaching. So, you would be well-advised to climb onto this bandwagon and scale the heights with us, without much ado.

Programmer's Heaven C# School Book

By Faraz Rasheed

The Programmer's Heaven C# School book covers the .NET framework and the C# language. Starting with the basics of the language, it goes on to cover object oriented programming techniques and a wide range of C# languages features including interfaces, exceptions and delegates. Later chapters cover practical topics including database access with ADO.NET, building Windows forms applications, multi-threading and asynchronous I/O. The final chapter covers new features in C# 2.0, including generics.
The book is divided into three progressive levels. In the first beginner stage we will be discussing the .Net Framework, C# Language Fundaments and Object Oriented Programming.
In the second intermediate section we will go into depth with Object Oriented constructs such as inheritance, polymorphism, abstract classes, interfaces, structures, enumerations and exceptions.
In the third and final advanced section we will delve into what is required to implement real world applications using C# with Base Libraries, focusing on topics such as Collections, Delegates, Events and Windows Programming with a number of controls, as well as Data Access with ADO.Net, Threads and Streams.

C# Tutorial Contents

C# Tutorial Lesson 1: Introducing the Microsoft .NET Framework
NET (dot-net) is the name Microsoft gives to its general vision of the future of computing, the view being of a world in which many applications run in a distributed manner across the Internet. We can identify a number of different motivations driving this vision.
Firstly, distributed computing is rather like object oriented programming, in that it encourages specialised code to be collected in one place, rather than copied redundantly in lots of places. There are thus potential efficiency gains to be made in moving to the distributed model.
Secondly, by collecting specialised code in one place and opening up a generally accessible interface to it, different types of machines (phones, handhelds, desktops, etc.) can all be supported with the same code. Hence Microsoft's 'run-anywhere' aspiration.
Thirdly, by controlling real-time access to some of the distributed nodes (especially those concerning authentication), companies like Microsoft can control more easily the running of its applications. It moves applications further into the area of 'services provided' rather than 'objects owned'.
Interestingly, in taking on the .NET vision, Microsoft seems to have given up some of its proprietary tendencies (whereby all the technology it touched was warped towards its Windows operating system). Because it sees its future as providing software services in distributed applications, the .NET framework has been written so that applications on other platforms will be able to access these services. For example, .NET has been built upon open standard technologies like XML and SOAP.
At the development end of the .NET vision is the .NET Framework. This contains the Common Language Runtime, the .NET Framework Classes, and higher-level features like ASP.NET (the next generation of Active Server Pages technologies) and WinForms (for developing desktop applications).
The Common Language Runtime (CLR) manages the execution of code compiled for the .NET platform. The CLR has two interesting features. Firstly, its specification has been opened up so that it can be ported to non-Windows platforms. Secondly, any number of different languages can be used to manipulate the .NET framework classes, and the CLR will support them. This has led one commentator to claim that under .NET the language one uses is a 'lifestyle choice'..............
C# versus Java
C# and Java are both new-generation languages descended from a line including C and C++. Each includes advanced features, like garbage collection, which remove some of the low level maintenance tasks from the programmer. In a lot of areas they are syntactically similar.
Both C# and Java compile initially to an intermediate language: C# to Microsoft Intermediate Language (MSIL), and Java to Java bytecode. In each case the intermediate language can be run - by interpretation or just-in-time compilation - on an appropriate 'virtual machine'. In C#, however, more support is given for the further compilation of the intermediate language code into native code...........

C# in Detail

By Jon Jagger
C# in Detail is also available as an instructor led course
  • an interactive, friendly, expert instructor
  • Jon has worked for Microsoft using C#
  • lots of great exercises
  • to make sure you understand
  • even more slides
  • with detail, explanations, and rationales
  • full slide notes
  • include careful comparisons with C++ and Java

C# Features

  • C#, C++ and Java - static typing, runtime polymorphism, exceptions, reference types
  • C# and C++ - compile time polymorphism ?,value types, operator overloading,
  • C# - unified type system
  • C# and Java - multiple public realization, non deterministic finalization, multi threading, garbage collection, single public inheritance, Object super base class, virtual execution system, reflection

Summary of Part 2

  • arrays: rectangular, ragged, params
  • string: immutable, readonly[], verbatim
  • class: ref/out, static c'tor, boxing
  • exceptions: lock, no throw-specs
  • GC: d'tor, using statement, IDisposable
  • inheritance: positional, virtual/override
  • interfaces: no fields, EII, properties, indexers
  • nested types: Java access, C++ semantics
  • delegates: function pointers, single and multicast
  • events: restricted multicast delegate
  • assemblies: logical DLL, no registry, versioning
  • namespaces: shorthand syntax
  • reflection: metadata, introspection, intercession
  • attributes: add to metadata, reflect

Click to Download

C# Classes - Threads, Winforms and XML

By Vijay Mukhi, Vinay Kalantri and Sonal Mukhi
This book presents myriad fascinating concepts about C# classes. It is classified into three sections, with each of them converging on distinct facets of classes available in the .Net framework
The curtains are raised with the chapter on Threads in Section I, which presents a nascent introduction to this topic. The topics of Events and Mutexes are also explored in detail.
The next chapter is on the Internet related classes. Here, the utility of the Web classes and their role in building server and client applications are highlighted.
The last chapter in this section takes on a different hue. It encapsulates the crux of writing programs to implement the concept of 'remoting'. This involves the composition of a client and a server program on different machines.
The spotlight then moves on to the concept of Winforms in Section II. This chapter is replete with practical and useful insights into how Winforms can be put to optimum use in the .Net world. The C# language provides the facility of generating user-interfaces having aesthetic appeal, either by implementing the ready-to-use Form Controls, or by using controls crafted by us, in order to receive inputs from an end user.
The subsequent chapter in this section delves upon the Database Controls. This chapter has been sedulously crafted, to capture the essence of this significant activity and to reveal its intricate details.
The ubiquitous task of printing is the focus of the next chapter. The contents of this chapter will equip you to print output with practiced panache.
The last section is devoted to XML, which is the most hyped language in the current market scenario. An XML file embodies an assortment of components, which will be unraveled, one at a time, in the chapters of this section.
At the outset, the common XML classes have been highlighted, to provide an introduction to XML concepts, which are used while programming in the C# language.
The next two chapters focus on DTD, which is an acronym for Data Type Definition, and also on the XML Data Document. They provide information on the various elements employed while generating an XML file.
The topic of XML Documentation provides a hiatus from the preceding abstruse topics. It has been laced with effervescent text and examples to liven up the proceedings.
We have applied utmost perspicacity to ensure that accurate, useful and relevant explanations, laced with lucid and practical examples, be presented to expound the various concepts to both, the amateur and the proficient programmer alike.
We assure you that, by the time you disembark from this intellectual voyage of discovery, the various concepts that have been presented, are doubtlessly bound to create an indelible imprint on your minds.

C# :Your Visual Blue Print for Building .Net Applications

By Eric Butow and Tommy Ryan
C#: Your Visual blueprint for building .NET applications uses simple,straightforward examples to teach you how to create powerful and dynamic programs.To get the most out of this book, you should read each chapter in order,from begining to end. Each chapter introduces new ideas and builds on the knowledge learned in previous chapters. Once you become familiar with C#: Your visual blueprint for building .NET applicaitons,this book can be used as an informative desktop reference.
Who this Book is For
If you are interested in writing programs for the new Microsoft C# programming language, then C#: Your visual blueprint for building .NET applicaitons is the book for you.
This book will take you through the basics of using the Visual Studio Microsoft Development Environment (MDE) window and familiarize you with the essentials of C# programming. The book even covers advanced topics including creating forms, macros,and web applications.
No prior experience with programming is required, but familiarity with the Microsoft Windows operating system installed on your computer is an asset.

ASP.Net With C# - The Basics

By Vijay Mukhi, Sonal Mukhi and Neha Kotecha
ASP.Net provides the most powerful environment for development of sophisticated, real-life business applications. It was only natural for us to get sucked into the vortex of the exciting opportunity that this language provides, to satiate our technical appetite. This book presents a realistic tableau of the vast repertoire of features of the ASP.Net language. We have scythed through the maze of technological jargon to present to you, in a simple yet comprehensive manner, all the salient features of the language.
The book commences with the assumption that you are a programming tyro, with no previous knowledge of ASP.Net or C#. It however, expects you to have a working knowledge of the Hyper Text Markup Language (HTML). The book covers the length and breadth of the ASP.Net framework. Since the C# language has been used for programming, the fundamentals of this language have also been covered.
The book begins with the basics of the ASP.Net and C#. Thereafter, it moves on to the built-in controls of ASP.Net. Next, it demonstrates how you can build your own custom controls. The text then veers on to the concepts of the built-in C# classes, and shows you how to build your own custom classes. It also covers the myriad aspects of handling databases, advanced concepts of controls, mysteries of Cookies, CGI Progamming and state management,Web Services and finally a Class Browser Application. It finally winds up with a peek into the security issues of designing an Internet application using ASP.Net. Thus, you’ll be able to appreciate, that a vast array of technical concepts of ASP.Net have been covered by this book.
This book is teeming with examples and explanations that discuss each concept threadbare. The various disparate concepts have been woven together to create a beautiful tapestry of the ASP.Net language. It has always been our modus operandi to break up large programs into smaller fragments, comprehend each fragment thoroughly and subsequently, synthesize all the fragments together to retrieve the original program. The same strategy has been employed in this book also. Each concept has been substantiated with examples so that you can see how each concept is implemented in real-life applications.
In our books, we have presented examples that emulate a concept supplied in the documentation, or some idea we found on the Internet. However, some of the concepts introduced are purely ours, and thus original. As far as we are concerned, you are free to use our accepted wisdom, as long as someone somewhere in the world benefits from it.
We are sanguine that this book will go a long way in providing ample food for thought, to sate the technological hunger of your minds. We implore you to put in sedulous effort in mastering this language, by reading all the material provided to you in this book with sincerity, and also by trying out all the examples that have been presented. We are confident that on doing so, you will be able to scale dizzying heights in the world of Internet programming.

A Comparison of Microsoft's C# programming language to Sun Microsystem's Java Programming Language

By Dare Obasanjo
The C# language is an object-oriented language that is aimed at enabling programmers to quickly build a wide range of applications for the Microsoft .NET platform. The goal of C# and the .NET platform is to shorten development time by freeing the developer from worrying about several low level plumbing issues such as memory management, type safety issues, building low level libraries, array boundschecking , etc. thus allowing developers to actually spend their time and energy working on their application and business logic instead. As a Java developer the previous sentence could be described as "a short description of the Java language and platform" if the words C# and the .NET platform were replaced with words Java and the Java platform.
What follows is an overview of similarities and differences between the language features and libraries of the C# and Java programming languages based on my experience using both languages. All code snippets below were tested on Microsoft's .NET Framework Beta 2 for C# snippets and Java™ 2, Standard Edition (J2SE™) version 1.4 Beta 2 for the Java snippets.

A Comprehensive Guide to C# and the .NET Platform

©2001 Andrew Troelsen
Advanced C# Class Construction Techniques
c-sharpcorner.com
This chapter rounds out your introduction to the core aspects of the C# language by examining a number of advanced (but extremely useful) syntactic constructs. To begin, you learn how to construct and use an indexer method. This C# mechanism enables you to build custom types, which exposes internal subtypes using the familiar bracket operator (i.e., []). If you have a C++ background, you will find that creating a C# indexer method is analogous to overloading the [] operator on a C++ class. Once you learn how to build an indexer, you then examine how to overload various operators (+, -, <, > and so forth) for a custom C# type.
This chapter then examines three techniques that enable the objects in your system to engage in bidirectional communications. First, you learn about the C# “delegate” keyword, which is little more than a type-safe function pointer. Once you learn how to create and manipulate delegates, you are in a perfect position to investigate the .NET event protocol, which is based on the delegation model. Finally, you discover how the use of custom interfaces can also enable bidirectional communications (which should ring a bell for those coming from a COM background).
I wrap up by examining how you can document your types using XML attributes, and how the Visual Studio.NET IDE automatically generates Web-based documentation for your projects. Although this might not qualify as a truly “advanced” technique, it is a high note on which to end the chapter.

A Programmer’s Introduction to C#, Second Edition

By Eric Gunnerson
apress.com
IN MOST PROGRAMMING LANGUAGES, some information is expressed through declaration, and other information is expressed through code. For example, in the following class member declaration
public int Test;
the compiler and runtime will reserve space for an integer variable and set its protection so that it is visible everywhere. This is an example of declarative information; it’s nice because of the economy of expression and because the compiler handles the details for us.
Typically, the types of declarative information are predefined by the language designer and can’t be extended by users of the language. A user who wants to associate a specific database field with a field of a class, for example, must invent a way of expressing that relationship in the language, a way of storing the relationship, and a way of accessing the information at runtime. In a language like C++, a macro might be defined that stores the information in a field that is part of the object. Such schemes work, but they’re error-prone and not generalized. They’re also ugly.
The .NET Runtime supports attributes, which are merely annotations that are placed on elements of source code, such as classes, members, parameters, etc. Attributes can be used to change the behavior of the runtime, provide transaction information about an object, or convey organizational information to a designer. The attribute information is stored with the metadata of the element and can be easily retrieved at runtime through a process known as reflection.
C# uses a conditional attribute to control when member functions are called. A use for the conditional attribute would look like this:
using System.Diagnostics;
class Test
{
[Conditional("DEBUG")]
public void Validate()
{
}
}
Most programmers will use predefined attributes much more often than writing an attribute class.........

User Interfaces in C#: Windows Forms and Custom Controls

By Matthew Macdonald
Custom controls are a key theme in .NET development. They can help your programming style by improving encapsulation, simplifying a programming model, and making user interface more “pluggable” (i.e., making it easier to swap out one control and replace it with a completely different one without rewriting your form code). Of course, custom controls can have other benefits, including the ability to transform a generic window into a state-of-the-art modern interface. Generally, developers tackle custom control development for one of three reasons:
  • To create controls that abstract away unimportant details and are tailored for a specific type of data. You saw this model in Chapter 6 with custom ListView and TreeView examples.
  • To create controls that provide entirely new functionality, or just combine existing UI elements in a unique way. An example of this is the directory browser control developed in this chapter.
  • To create controls with a distinct original look, or ones that mimic popular controls in professional applications (like Microsoft’s Outlook bar) that aren’t available to the masses. This topic is considered briefly in this chapter, and returned to in Chapter 13, with GDI+.

Creating custom controls in .NET is far easier than it has been in languages like C++ or VB, where you typically need to embrace the ActiveX model to create a truly shareable component. As most developers have found, ActiveX controls can be difficult to distribute because every version needs to be registered. Creating ActiveX controls also requires a bit of wizardry, with special care taken to handle property pages, design-time versus runtime appearance, and state management.

In .NET, creating a custom control is as easy as creating an ordinary class. You simply inherit from the best possible ancestor and add the specific features you need. Best of all, you can create a custom control class as part of an existing project, and then decide later to place it in a separate assembly that can be shared with other programmers.

This chapter introduces the different types of custom controls, and the types of problems they can solve. You will look at several key examples, including a thumbnail image viewer and a masked text box, and consider advanced techniques like creating multithreaded controls. However, you won’t learn how to make these controls behave happily in Visual Studio .NET. That topic, as well other issues like control distribution and licensing, are picked up in the next chapter.

Click to Read More/Download

User Interfaces in C#: Windows Forms and Custom Controls

Draft C# Language Specification

March 2001
Internal Working Document Released for informational purposes only
ECMA TC39/TG2
Microsoft
This ECMA Standard is based on a submission from Hewlett-Packard, Intel, and Microsoft, that described a language called C#, which was developed within Microsoft. The principal inventors of this language were Anders Hejlsberg, Scott Wiltamuth, and Peter Golde. The first widely distributed implementation of C# was released by Microsoft in July, 2000, as part of its .NET Framework initiative.
ECMA committee TC39 Task Group 2 (TG2) was formed in September, 2000, to produce a standard for C#. Another committee, TG3, was also formed at that time to produce a standard for a library and execution environment called Common Language Infrastructure (CLI). (CLI is based on a subset of the .NET Framework.) Although Microsoft.s implementation of C# relies on CLI for library and runtime support, other implementations of C# need not, provided they support an alternate way of getting at the minimum CLI features required by this C# standard.
As the definition of C# evolved, the goals used in its design were as follows:
  • C# is intended to be a simple, modern, general-purpose, object-oriented programming language.
  • The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, attempts to use uninitialized variables, automatic garbage collection, and so on. Program robustness, durability, and programmer productivity are important.
  • The language is intended for use in developing software components suitable for deployment in distributed environments.
  • Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++.
  • Support for internationalization is very important.
  • C# is intended to be suitable for writing programs for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions.
  • Although C# programs are intended to be economical with regards to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.

The development of this standard started in November, 2000. It is intended that the final version of this draft ECMA Standard will be submitted to ISO/IEC JTC 1 for adoption under its fast-track procedure. It is expected there will be future revisions to this standard, primarily to add new functionality.

Click to Read more/Download

Sams Teach Yourself C# in 24 Hours

By James Foxall and Wendy Haro-Chun
With Microsoft's introduction of the .NET platform, a new, exciting programming language was born. C# is the language of choice for developing on the .NET platform, and Microsoft has even written a majority of the .NET Framework using C#. C# is a modern object-oriented language designed and developed from the ground up with a best-of-breed mentality, implementing and expanding on the best features and functions found in other languages. C# combines the power and flexibility of C++ with the simplicity of Visual Basic.
This book is divided into five parts, each of which focuses on a different aspect of developing applications with C#. These parts generally follow the flow of tasks you'll perform as you begin creating your own programs using C#. I recommend that you read them in the order in which they appear.
Part I The Visual Studio Environment teaches you about the Visual Studio's C# development environment, including how to navigate and access 'numerous tools. In addition, you'll learn some key development concepts such as objects, collections, and events.
Part II Building a User Interface shows you how to build attractive and functional user interfaces. In this part, you'll learn about forms and controlsthe user-interface elements such as text boxes and list boxes.
Part III Making Things HappenProgramming! teaches you the nuts and bolts of C# programmingand there's a lot to learn. You'll discover how to create methods, as well has how to store data, perform loops, and make decisions in code. After you've learned the core programming skills, you'll move into object-oriented programming and debugging applications.
Part IV Working with Data introduces you to working with a database and shows you how to automate external applications such as Word and Excel. In addition, this part teaches you how to manipulate a user's file system.
Part V Deploying Solutions and Beyond shows you how to distribute an application that you've created to an end user's computer. Then, the focus is brought back a bit to take a look at Web programming and Microsoft's .NET initiative from a higher, less-technical level.

Dissecting a C# Application: Inside SharpDevelop

Copyright Apress
Learn advanced .NET programming techniques by getting an insiders' look at a complete application!
The developers who created SharpDevelop give you an inside track on application development with a guided tour of the source code for SharpDevelop. They will show you the most important code features and explain how you can use these techniques in your own projects.
You will gain valuable experience of building an application on this scale, learning from the decisions, mistakes, problems and solutions that lead to the current version on SharpDevelop. The SharpDevelop team will show you how to:
  • Build a highly modular application
  • Provide a flexible, extendable, customizable user interface
  • Manage the efforts of translators for efficient internationalization
  • Represent and manipulate text efficiently
  • Code search and replace functionality
  • Construct reusable controls
  • Implement a parser to provide syntax highlighting and auto-completion as users type
  • Use reflection to access information about .NET classes
  • Create a Windows Forms designer
  • Generate code programmatically

Click to Read More

Followers