Home Page Icon
Home Page
Table of Contents for
The java.awt.im Package
Close
The java.awt.im Package
by Adam Freeman, Allen Jones
C# for Java Developers
C# for Java Developers
SPECIAL OFFER: Upgrade this ebook with O’Reilly
Introduction
Why We Wrote This Book
Who Should Read This Book
Organization of This Book
Part I: Introducing .NET
Part II: The C# Language
Part III: Programming .NET with C#
Part IV: Advanced Topics
Appendices
System Requirements
Support
I. Introducing .NET
1. Introduction to Microsoft .NET
Background
Goals of .NET
System Integration Using XML
Platform Neutrality
Language Neutrality
Technology Consolidation
Overview of .NET
The .NET Framework
Microsoft Intermediate Language
The Common Language Runtime
The Common Type System
The Common Language Specification
Base Class Libraries
Development Tools
Command-Line Tools
Integrated Development Environment
Languages
Visual C# .NET
Visual Basic .NET
Visual C++ .NET
Visual J# .NET
JScript .NET
Other languages
Server Products
Devices and Clients
Building Block Services
Platform Migration and Integration
Web Services and Open Standards
Java User Migration Path to Microsoft .NET
Visual J# .NET
Java Language Conversion Assistant
Third-Party Products
Skills Transfer
Summary
2. Comparing Java and .NET Technologies
Java 2 Platform, Standard Edition
Java 2 Platform, Enterprise Edition
Summary
II. The C# Language
3. Creating Assemblies
Using the C# Compiler
Other .NET Framework Tools
Assemblies
Contents of an Assembly
The Manifest
Modules
Resources
Single-File and Multifile Assemblies
Creating a Single-File Assembly
Setting metadata for a single-file assembly
Creating a Multifile Assembly
Setting metadata for a multifile assembly
Summary
4. Language Syntax and Features
General Program Structure
The Main Method
Comments
Documentation Comments
Case Sensitivity
Naming Conventions
Source Code Character Sets and Unicode
Identifiers
Source File Names and Contents
Keywords
Package and Namespace Keywords
Simple Type and Constant Keywords
Type Declaration, Access, and Manipulation Keywords
Modifier Keywords
Flow Control Keywords
Exception Handling Keywords
Unmanaged Code Keywords
Keywords as Identifiers
Operators
Precedence and Associativity
Literals
Modifiers
Access Modifiers
Inheritance Modifiers
Other Modifiers
Namespaces
Declaring Namespaces
Using Namespaces
Statements
Labeled Statements
Selection and Iteration Statements
The switch Statement
The foreach Statement
Jump Statements
The return Statement
The throw Statement
The break and continue Statements
The goto Statement
Other Statements
The try Statement
The lock Statement
The checked and unchecked Keywords
The using Statement
The fixed Statement
Summary
5. Data Types
Types
Unified Type System
Boxing
Implicit boxing
Unboxing
Value Types
Structs
Declaration
Inheritance
Modifiers
Empty constructors and structs
Instantiation
Members
Assigning and passing structs
Issues with structs
Simple Types
Enumerations
Declaration
Modifiers
Members and inheritance
Reference Types
Classes
Declaration
Modifiers
Members
Abstract classes
Default constructor accessibility
Preventing class instantiation
Anonymous and local classes
Interfaces
Declaration
Modifiers
Members
Implementing interfaces
Explicit interface implementation
Arrays
Declaration and creation
Initialization
The foreach statement
Arrays as objects and collections
Delegates
Declaration
Instantiation
Invoking a delegate
Modifiers
Events
Conversion
Implicit Conversion
Implicit numeric conversion
Implicit enumeration conversion
Implicit reference conversion
Implicit boxing conversion
Explicit Conversion
Explicit numeric conversion
Explicit enumeration conversion
Explicit reference conversion
Explicit unboxing conversion
User-Defined Conversion
Members
Member Types and Declaration Context
Versioning and Inheritance of Members
Overriding
Hiding
New Virtual Members
Sealed Members
Base Class Member Access
Static Members
Member Attributes
Member Modifiers
Constants
Declaration
Modifiers
Fields
Declaration
Modifiers
Fields as Struct Members
Read-Only Fields
Static and Instance Constructors
Declaration
Modifiers
Static Constructors
Destructors
IDisposable
Methods
Declaration
Modifiers
Parameters
Parameter arrays
Events
Declaration
Event invocation and usage
.NET implementation guidelines
Events and inheritance
Modifiers
Accessors
Properties
Declaration
Modifiers
Properties as Members of Interfaces
Indexers
Declaration
Modifiers
Indexers as Members of Interfaces
Operators
Declaration
Unary operators
Binary operators
Conversion operators
Cross-Language Considerations
Nested Types
Variables
Value Parameters
Reference Parameters
Output Parameters
Summary
6. Advanced Language Features
Threading and Synchronization
Exceptions and Exception Handling
Declaring Exceptions
Catching Exceptions
Throwing Exceptions
The Exception Hierarchy
The System.Exception Class
Exception Chaining
Attributes
Attribute Names
Attribute Specification
Attribute Parameters
Positional parameters
Named parameters
Attribute Target Specification and Global Attributes
Custom Attributes
The System.AttributeUsage Attribute
Attribute Declaration
Attribute Constructors
Named Parameters
Compile-Time Attributes
System.Diagnostics.ConditionalAttribute
System.ObsoleteAttribute
Assertions
Preprocessor Directives
#define and #undef
#if, #elif, #else, and #endif
#region and #endregion
#warning and #error
#line
Unsafe Code
The unsafe Modifier
The /unsafe Compiler Flag
Managed and Unmanaged Types
The sizeof Operator
Pointers
Declaration
Address-Of Operator and Pointer Indirection
Pointer Member Access
Pointer Element Access
Pointer Arithmetic
Pointer Comparison
Pointer Conversion
The fixed Statement
The stackalloc Command
Summary
III. Programming .NET with C#
7. Strings and Regular Expressions
Strings
Creating Strings
Comparing Strings
Copying Strings
String Length
String Concatenation
Changing Case
Working with Characters
Working with Substrings
Splitting Strings
Strings as Keys
Parsing Strings
Formatting Strings
The IFormattable Interface
Encoding Strings
Dynamically Building Strings
Regular Expressions
Compiling Regular Expressions
Regular Expression Compilation Flags
The RegexOptions.Compiled Flag
Manipulating Text
Matching Regular Expressions
Replacing Substrings
Splitting Strings
Ad Hoc Regular Expressions
Summary
8. Numbers and Dates
Numbers
Numbers as Objects
Interfaces
IComparable
IFormattable
IConvertible
Members
Floating-point members
Decimal members
Converting Numbers
Formatting Numbers
Standard Numeric Format Strings
Custom Numeric Format Strings
Mathematical Functions
Random Numbers
Dates and Times
System.TimeSpan
Creating Dates
Manipulating Dates
Formatting Dates
Parsing Strings
Summary
9. Collections
Indexers
Collection Interfaces
ICollection
IEnumerable, IEnumerator, and the foreach Keyword
IComparer and IComparable
Other Collection Interfaces
Basic Collections
Arrays
Arrays as Objects
Hashtable
ArrayList
Queue
Stack
SortedList
Specialized Collections
Strongly Typed Collections
NameObjectCollectionBase and NameValueCollection
StringCollection
StringDictionary
Unusual Collections
ListDictionary
HybridDictionary
The CollectionsUtil Class
Synchronization
Custom Collections
Summary
10. Streams, Files, and I/O
Working with the Console
Writing to the Console
Reading from the Console
Changing the Console Streams
Console Summary
The File System
Paths
Files and Directories
Differentiating Between Files and Directories
Using the Exists methods
Using bitwise operations
Getting Streams from Files
Creating a stream directly
Creating a stream indirectly
Comparison with Java
Streams
The Foundation of Streams
Base Streams
Pass-Through Streams
Readers and Writers
BinaryReader and BinaryWriter
TextReader and TextWriter
StreamReader and StreamWriter
StringReader and StringWriter
Synchronizing Streams
Streams Summary
Asynchronous I/O
Asynchronous I/O Summary
Isolated Storage
Obtaining and Managing the Isolated Stores
Reading and Writing Isolated Data
Isolated Storage Summary
Object Serialization
Simple Serialization
Selective Serialization
Custom Serialization
Summary
11. XML Processing
XmlNameTable
XmlReader
XmlTextReader
Opening an XML Source
XmlTextReader Properties
Reader state
Controlling parsing behavior
Working with XML Nodes
Node types
Node names
Node values and contents
Other node properties
Read operations
Accessing Attributes
Direct attribute value access
Attribute node access
Closing an XmlTextReader
Unimplemented Members
XmlValidatingReader
Creating an XmlValidatingReader
Specifying a Validation Type
Validation Events
Cached Schemas
Differences from XmlTextReader
XmlNodeReader
XmlWriter
XmlTextWriter
XmlTextWriter Creation
XmlTextWriter Status
Writing XML Documents
Output Formatting
Namespace Support
Closing the XmlTextWriter
Document Object Model
Key Classes
Document Creation
Other Key Differences
XPath
IXPathNavigable
XPathDocument
XPathNavigator
Node Types
Node Navigation
Attribute and Namespace Node Navigation
Node Properties
Queries
Select
Evaluate
Matches
Optimized Queries
XSL Transformations
Creating a Transformer
Loading a Style Sheet
Transforming XML Data
Extensibility
Summary
IV. Advanced Topics
12. Reflection
Dealing with Types
Local Types
Foreign Types
Inspecting Types
Inspecting Constructors and Methods
Inspecting Properties
Inspecting Events
Inspecting Parameters
Inspecting Fields
Inspecting Attributes
Late Binding
Instantiation
Manipulation
Summary
13. Threading and Synchronization
Threads
Creating and Starting Threads
Suspending and Resuming Threads
Stopping Threads
Setting Thread Priorities
Thread States
Interrupting a Thread
Local Thread Data
Data Slots
Metadata Annotation
Timers
System.Threading.Timer
System.Timers.Timer
Basic Threading Summary
The ThreadPool Class
Explicit Thread Alternative
Waiting for an Event
Synchronization
Basic Locking
Waiting and Notifying
Enter, TryEnter, and Exit
ReaderWriterLock
WaitHandle
Mutex
AutoResetEvent and ManualResetEvent
Summary
14. Networking
Accessing the Internet
URLs and URIs
Constructors
Methods
The WebClient Class
Downloading Data
Uploading Data
Configuring WebClient
Request headers
Response headers
Setting a base address
WebRequest and WebResponse
WebRequest
Creating a request
Configuring a request
Setting Proxies
Request Credentials
WebResponse
Getting response data
Protocol-Specific Request and Response Classes
File protocol classes
HTTP protocol classes
HTTP Connection Features
Setting Defaults for All Hosts
Configuring a Specific Host
Names and Addresses
Using the Domain Name System
IP Addresses
Application Endpoints
Sockets
Creating a TCP Client
Creating a TCP Server
Using UDP
Programming with Native Sockets
Creating Sockets
Client Sockets
Server Sockets
Configuring Sockets
Asynchronous Sockets
Summary
15. Remoting
First Steps
Creating the Server
Creating the Client
Building and Testing the Example
Copies and References
Channels
Creating a Channel
Registering a Channel
Using More than One Channel
Publishing and Activation
Client Activation
Server Activation
Singleton
SingleCall
Publishing an Existing Instance
Using Configuration Files
Defining Channels
Server Configuration
Client Configuration
Publishing Limitations and Scope
Methods in the Object Class
Private Methods and Delegates
Static Fields and Methods
Lifetime Leases
Configuring a Lease
Renewing a Lease
Renewing a Lease Directly
Sponsorship Renewal
Setting Lease Defaults
Summary
16. Database Connectivity
Data Providers
Interfaces and Implementations
Data Provider Sample Code
Connections
Creating and Opening Connections
Connection Pooling
Closing a Connection
Changing the Active Database
Transactions
Commands
Creating Commands
Configuring Commands
Configuring an IDbCommand to execute a direct SQL statement
Configuring an IDbCommand to execute a stored procedure
Parameters
Executing Commands and Processing Results
IDataReader
DataSet
DataSet Component Classes
Creating a DataSet
Managing a DataSet with a Data Adapter
Manually Managing a DataSet
XML Support
DiffGram
XmlDataDocument Synchronization
Summary
17. Security and Cryptography
Code Access Security
Programming for CAS
Declarative CAS Statements
Statement Scope
Declarative Statement Syntax
Using Optional Permissions
Refusing Permissions
Assessing Declarative Statements
Imperative Security Demands
CAS Policies
Role-Based Security
Cryptography
Encrypting and Decrypting Data
Symmetrical Encryption
Asymmetrical Encryption
Hash Codes
Digital Signatures
Summary
18. Graphics and UI
Windows Forms
Using Windows Forms
Adding and Disposing of Controls
Starting and Stopping a Forms Application
Compiling
Control Overview
Docking and Anchoring
Anchoring
Docking
Handling Events
Drawing with GDI+
Obtaining a Graphics Instance
Lines, Shapes, and Curves
Drawing Strings
Drawing Images
Double Buffering
Summary
19. Introduction to XML Web Services
Creating XML Web Services
Building and Deploying XML Web Services
Deployment Directory
Compiling
Creating the Directive
Configuring XML Web Services
Protocols
Testing XML Web Services
Summary
State Management
Application State Management
Session State Management
XML Web Service Clients
Creating a Proxy Class
Using a Proxy Class
Asynchronous Programming
Summary
A. Platform Integration
Runtime Environment
Command-Line Arguments
Environment Variables
Drives and Directories
Machine and Operating System Information
Process Control
Creating New Processes
Obtaining a Reference to an Existing Process
Terminating Processes
Information About Existing Processes
Process Synchronization and Events
Windows Registry
The Registry Class
The RegistryKey Class
Remote Registry Access
Windows Event Log
Writing to the Event Log
Registering an Event Source
Writing Events
Reading from the Event Log
Creating and Deleting Custom Logs
Event Log Notifications
Windows Services
The Service Application
Event Logging
Service Installer
ServiceProcessInstaller
ServiceInstaller
Installer Compilation and Service Installation
Service Controller
B. Shared Assemblies
Creating a Shared Assembly
The Global Assembly Cache
Assembly Versions
Side-by-Side Execution
Assembly Version Policies
Creating a publisher policy file
Creating and installing a publisher policy assembly
Assembly Probing
Codebase Probing
Summary
C. Configuring Applications
Application Configuration Files
Specifying a CLR Version
Using Concurrent Garbage Collection
Managing Assembly Versions and Locations
Registering Remote Objects
Application Settings
Simple Settings
Complex Settings
Single Tag Sections
Name/Value Sections
Dictionary Sections
Ignore Sections
Summary
D. Garbage Collection
Controlling the Garbage Collector
Forcing a Collection
Generations
Concurrent Collection
Finalizing and Disposing
Destructors
Resurrection
Weak References
Summary
E. Cross-Language Code Interoperability
The Common Type System
The Common Language Specification
Writing CLS-Compliant Code in C#
The CLSCompliant Attribute
Summary
F. Java to .NET API Reference
The java.awt Package
The java.awt.color Package
The java.awt.datatransfer Package
The java.awt.dnd Package
The java.awt.event Package
The java.awt.font Package
The java.awt.geom Package
The java.awt.im Package
The java.awt.im.spi Package
The java.awt.image Package
The java.awt.image.renderable Package
The java.awt.print Package
The java.io Package
The java.lang Package
The java.lang.ref Package
The java.lang.reflect Package
The java.math Package
The java.net Package
The java.nio Package
The java.rmi Package
The java.security Package
The java.sql Package
The java.text Package
The java.util Package
The java.util.jar Package
The java.util.logging Package
The java.util.prefs Package
The java.util.regex Package
The java.util.zip Package
The javax.swing Package
The javax.swing.border Package
The javax.swing.colorchooser Package
The javax.swing.event Package
The javax.swing.filechooser Package
The javax.swing.plaf Package
The javax.swing.table Package
The javax.swing.text Package
The javax.swing.tree Package
The javax.swing.undo Package
The javax.sql Package
The javax.xml.parsers Package
The javax.xml.transform Package
The org.w3c.dom Package
The org.xml.sax Package
G. About the Authors
Allen Jones
Adam Freeman
H. Pipe Valves
Index
About the Authors
SPECIAL OFFER: Upgrade this ebook with O’Reilly
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
The java.awt.geom Package
Next
Next Chapter
The java.awt.im.spi Package
The
java.awt.im
Package
The .NET Framework doesn’t provide equivalent functionality for this package.
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset