Microsoft® .NET Compact Framework (Core Reference)

Book description

The Microsoft® Windows® .NET Compact Framework brings the power of the .NET Framework to handheld devices such as Pocket PCs and smart phones. Learn exactly how to build killer applications—and how to solve typical problems—in developing for resource-constrained devices with this book. You’ll find specifics on how to develop GUI elements with Windows Forms, access and store data with Microsoft ADO.NET and integrate it across the enterprise with XML Web services, work with Microsoft SQL Server™ CE, develop applications that connect and disconnect across wireless networks, and more—all with working code samples. You even get a quick reference to the differences between the .NET Compact Framework and the full .NET Framework.

Table of contents

  1. Microsoft® .NET Compact Framework (Core Reference)
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. A Note Regarding Supplemental Files
    3. Dedication
    4. Acknowledgments
    5. Introduction
      1. System Requirements
      2. Sample Code
      3. Support
    6. I. .NET Compact Framework Architecture
      1. 1. Introducing the .NET Compact Framework
        1. A Brief History of Smart Mobile Computing Devices
          1. Beginnings of Portable Computing
          2. PSION Invents the Personal Organizer
          3. PDA Market Expands
          4. Microsoft and Handhelds
        2. Microsoft .NET
          1. Before .NET
          2. .NET Is a Better COM
          3. Is That It?
          4. .NET and Mobility
            1. .NET Compact Framework
            2. SQL Server CE
            3. ASP.NET Mobile Controls
            4. Mobile Information Server
        3. .NET Compact Framework Target Platforms
          1. Platforms That Run It
          2. And Platforms That Don’t
        4. Developer Tools
          1. Visual Studio .NET 2003
          2. eMbedded Visual Tools Version 3
          3. eMbedded C++ Version 4
          4. Getting Started with Smart Device Projects in Visual Studio .NET
            1. Differences between Smart Device and PC Application Projects
            2. Creating a Smart Device Application Project
            3. Smart Device Application Wizard
          5. Managing Your Project
            1. Help System
          6. Creating a Hello World Application
            1. Create a Smart Device Application Project
            2. Modify the Project
          7. Using the Emulator
            1. Requirement for Development PC to Be on a Network
            2. Using the Pocket PC Emulator
            3. Using the Windows CE .NET Emulator
        5. Unique Challenges Facing Mobile Developers
          1. Get Data to Your Device
            1. XML Web Services
            2. SQL Server CE
          2. Resource-Constrained Devices
          3. Security Implications
        6. Summary
      2. 2. .NET Framework Fundamentals
        1. .NET Compact Framework Execution Environment
          1. Common Language Runtime
            1. Managed Code and Native Code
            2. Portable Execution Environment?
            3. Application Domain Hosts
            4. Application Domains
            5. Verifiable Type-Safe Execution
            6. JIT Compilation Not Interpreted!
            7. Garbage Collection
            8. Rich Exception Handling
            9. Remote Debugging
          2. Assemblies
        2. Working with Class Objects
          1. Constructors and Finalizers
          2. Releasing Resources with IDisposable
            1. The C# using Statement
          3. Delegates and Events
        3. .NET Compact Framework Class Libraries
          1. Class Library Structure
            1. System.Object
            2. Value and Reference Types
            3. Elementary Data Types
            4. Language Interoperability
            5. Common Language Specification
          2. Primary Differences from the Full .NET Framework
            1. Application Configuration Files
            2. COM Interop
            3. Internet Deployment
            4. Ngen.exe
            5. Reflection Emit
            6. Remoting
            7. Serialization
            8. System.CodeDom Namespace
            9. Support for Printing
            10. Visual Basic File I/O
            11. Web Forms
            12. XPath/XSLT
        4. Summary
    7. II. Developing Applications with the .NET Compact Framework
      1. 3. GUI Development with Windows Forms
        1. Introducing the System.Windows.Forms Namespace
        2. Creating Windows Forms
          1. The Forms Designer
          2. Windows Forms Target Platform Differences
            1. Pocket PC Projects
            2. Windows CE .NET Projects
        3. Comparing Forms Behavior in the .NET Framework and the .NET Compact Framework
          1. AcceptButton and CancelButton
          2. AutoScroll
          3. Anchor
          4. IsMdiContainer
          5. KeyPreview
          6. TabIndex and TabStop
          7. Keyboard Events
          8. Paint and Resize Events
          9. Supported and Unsupported Controls
          10. Graphics Support
        4. Exploring Windows Forms Controls
          1. Creation of Controls
          2. Members of Controls
            1. Properties
            2. Methods
            3. Events
            4. Property and Event Settings
          3. .NET Compact Framework Controls
            1. The Button Control
            2. The CheckBox Control
            3. The ComboBox Control
            4. The ContextMenu Control
            5. The DataGrid Control
              1. Determining the User’s Selection
              2. Formatting DataGrid Output
            6. The DomainUpDown Control
            7. The HScrollBar and VScrollBar Controls
            8. The ImageList Control
            9. The Label Control
            10. The ListBox Control
            11. The ListView Control
            12. The MainMenu Control
            13. The NumericUpDown Control
            14. The OpenFileDialog and SaveFileDialog Controls
            15. The Panel Control
            16. The PictureBox Control
            17. The ProgressBar Control
            18. The RadioButton Control
            19. The StatusBar Control
            20. The TabControl Control
            21. The TextBox Control
            22. The Timer Control
            23. The ToolBar Control
            24. The TrackBar Control
            25. The TreeView Control
        5. Summary
      2. 4. Building Windows Forms Applications
        1. Working with Forms
          1. Setting Properties of the Form Class
          2. Keeping to Form Display Guidelines
          3. Creating Custom Dialog Boxes
          4. Using Built-In Dialog Boxes
        2. Working with the InputPanel Control
        3. Using the MainMenu Control
        4. Using the ToolBar Control
        5. Programming Form Activation and Deactivation on Pocket PC
          1. Programming Activate and Deactivate
          2. Programming Form Close
          3. Closing of Applications by the Pocket PC Shell
        6. Handling the Tap-and-Hold Event
        7. Handling Pocket PC Hardware Keys
        8. Giving an Application Its Final Touches
          1. Associating an Icon with Your Application
          2. Adding a Shortcut to the Start Menu
        9. General Design Guidelines
        10. Summary
      3. 5. Testing and Debugging
        1. Detecting and Correcting Programming Errors
        2. Using the Debugger
          1. Debugging an Example Application
          2. Understanding Default Exception Handling
          3. Handling Exceptions in the Debugger
        3. Drawing on Debugger Features
          1. Entering Break Mode
          2. Creating a Breakpoint
          3. Watching Variables and Expressions
            1. Command Window
            2. Watch Window
            3. DataTips
          4. Stepping Through an Application
          5. Continuing a Program from Break Mode
          6. Terminating a Program
          7. Removing Breakpoints
          8. Setting More Complex Breakpoints
            1. Breakpoints with Conditions
            2. Breakpoints with Counters
            3. Disabled Breakpoints
          9. Starting Applications Without Debugging
        4. Unsupported Debugger Features
        5. Tracing Output from an Application
        6. Using Assertions Within an Application
        7. Handling Exceptions in the Debugger
        8. Controlling Release Code Size
        9. Generating Longer Error Messages in Exceptions
        10. Adopting Strategies for Testing and Debugging
        11. Configuring the Emulator from Visual Studio
        12. Starting the Emulator Manually
        13. Using Emulator Skins
          1. Using Image Files
          2. Emulating Hardware Buttons
          3. Starting the Emulator with a Skin File
        14. Summary
      4. 6. Completing and Distributing Your Application
        1. Choosing Project Settings
          1. Using the File Build Action Property
          2. Associating an Icon with Your Application
          3. Setting the Deployment Directory
        2. Packaging Your Application
          1. Creating Processor-Specific CAB Files
          2. Building CAB Files Using Visual Studio .NET
          3. Building CAB Files Using CAB Wizard
          4. Using the Resource File Generator
          5. Understanding the Configuration File
            1. Configuration File Directory Identifiers
            2. Description of the Version Section
            3. Applying the CEStrings Section
            4. Using the Strings Section
            5. Description of the CEDevice Section
            6. Specifying the DefaultInstall Section
            7. Defining the SourceDisksNames Section
            8. Defining the SourceDisksFiles Section
            9. Specifying the DestinationDirs Section
            10. Usage of the CopyFiles Section
            11. Description of the AddReg Section
          6. Usage of the CEShortCuts Section
        3. Distributing Your Application
          1. Installing the .NET Compact Framework
          2. Deploying from a Web Site
          3. Deploying from a File Share
          4. Deploying from Another Device
          5. Deploying with Memory Storage Cards
          6. Deploying Through ActiveSync
            1. Creating an Application Manager Initialization File
        4. Using Trickle-Feed Deployment
        5. Installing Assemblies into the Global Assembly Cache
          1. Understanding Strong-Named Assemblies
            1. Signing an Assembly with a Strong Name
          2. Using Side-by-Side Versioning
            1. Version Policy
        6. Summary
    8. III. Common Programming Tasks
      1. 7. Working with Collection Classes
        1. Introducing the .NET Framework Collection Classes
        2. Using Simple Arrays
          1. Initializing Arrays of Reference Types
          2. Working with Multidimensional Arrays
            1. Rectangular Arrays
            2. Arrays of Arrays
          3. Converting Array Types
        3. Using the .NET Compact Framework Collections
          1. Creating an ArrayList Collection
          2. Storing Key-and-Value Pairs Using a Hashtable Collection
          3. Using the Stack Class
          4. Storing Elements with a ListDictionary Collection
          5. Using the HybridDictionary Collection
          6. Storing String Key-and-Value Pairs with NameValueCollection
        4. Sorting Objects in Collections
          1. Sorting with IComparable
          2. Implementing Multiple Sort Orders with IComparer
        5. Creating Your Own Collections
        6. Summary
      2. 8. Working with Dates and Strings
        1. Understanding the String Class
          1. Using Strings
            1. Creating and Comparing Strings
            2. Creating Strings from Other Strings
            3. Searching Strings
            4. Modifying Strings
            5. Using String Utility Methods
          2. Differences from the Full .NET Framework String Class
            1. Using the CharEnumerator Class
        2. Using the StringBuilder Class
          1. Using StringBuilder Methods and Properties
          2. Differences from the Full .NET Framework StringBuilder Class
            1. Using the EnsureCapacity Method
            2. Using the Replace Method
        3. Using Dates
          1. Constructing Dates
          2. Using DateTime Properties
          3. Using DateTime Arithmetic Methods
          4. Using DateTime Utility Methods
          5. Using DateTime Operators
          6. Differences from the Full .NET Framework
        4. Using Regular Expressions
          1. Understanding Regular Expressions
          2. Using Simple Regular Expression Matches and the Match Object
          3. Processing Multiple Matches with the MatchCollection Object
          4. Using Groups and Captures
          5. Replacing Text Patterns
          6. Using the Split Method
        5. Formatting Strings for Output
          1. Understanding Concepts and Terminology
          2. Working with Format Specifiers
            1. Using Format Specifiers
            2. Classifying Format Specifiers
            3. Using Standard Numeric Format Specifiers
            4. Using Custom Numeric Format Specifiers
            5. Formatting Dates and Times
            6. Using Enumerated Type Formatting
          3. Using Format Specifications and the String.Format Method
          4. Understanding Format Providers
            1. Using Cultural Settings with Date Formats
        6. Parsing
          1. Resolving Parsing Issues
          2. Parsing Dates
        7. Summary
      3. 9. Working with XML
        1. Using XML in the .NET Compact Framework
        2. Differences from the Full .NET Framework
        3. Reading XML with the XmlReader Class
          1. Understanding the XmlTextReader Class
          2. Constructing an XmlTextReader Object
          3. Reading an XML Document with the XmlTextReader Class
          4. Disregarding Unnecessary Nodes
          5. Reading Attribute Nodes
          6. Handling Namespaces with XmlTextReader
          7. Dealing with Validation, DTDs, and Entities
          8. Handling Comment Nodes
          9. Handling CDATA Nodes
        4. Writing XML with the XmlWriter Class
          1. Writing an XML Document with the XmlTextWriter Class
          2. Constructing an XmlTextWriter
          3. Writing XML Data
          4. Handling Namespaces with XmlTextWriter
        5. Processing XML with the XmlDocument Class
          1. Understanding the XmlDocument Class
          2. Differences from the Full .NET Framework
          3. Reading XML with the XmlDocument Class
            1. Navigating an XML Document
            2. Handling Namespaces
            3. Accessing Element Values
            4. Accessing Attributes
            5. Accessing Other Types of XmlNode
            6. Reading XML from an XmlNode
          4. Searching an XML Document with GetElementsByTagName
          5. Modifying an XML Document
            1. Modifying Values
            2. Adding an Element
            3. Adding an Attribute
            4. Removing Elements and Attributes
          6. Saving an XML Document
        6. Summary
      4. 10. Input and Output
        1. Understanding the Stream Class
          1. Creating a FileStream Object
          2. Specifying File Access Modes for Streams
          3. Specifying File Sharing for Streams
          4. Reading and Writing Bytes Using a FileStream Object
          5. Using the BinaryReader and BinaryWriter Classes
          6. Seeking on Streams
          7. Locking Files
          8. Using the NetworkStream Class
          9. Handling Network Errors When Using NetworkStream
          10. Performing Asynchronous Read/Write Operations on NetworkStream Objects
          11. Using the MemoryStream Class
          12. Implementing a Product Ordering Example
        2. Using the StreamReader and StreamWriter Classes
          1. Creating StreamReader and StreamWriter Objects
          2. Reading a File Stream with a StreamReader Object
          3. Using Encodings with StreamReader and StreamWriter Objects
          4. Specifying Byte Ordering When Using Encodings
          5. Writing to a File Stream with StreamWriter
        3. Processing Strings with StringReader and StringWriter
        4. Using the File, Path, and Directory Classes
          1. Using the File Class to Create a File
          2. Using the Directory Class
          3. Differences from the Full .NET Framework
          4. Using the Path Class
        5. Summary
      5. 11. Networking
        1. Using the System.Net Namespace
        2. Using the WebRequest and WebResponse Classes
          1. Understanding WebRequest and WebResponse Basics
          2. Fetching a Resource Using HTTP
          3. Handling Errors
          4. Working with HTTP Headers
          5. Network Transfer Encoding
          6. Sending Data to the Server with HTTP GET and HTTP POST
            1. Using HTTP GET Query String
            2. Using HTTP POST
          7. Alternatives to Cookies for Session State Support
          8. Securing Network Transfers with SSL
          9. Authenticating Requests with the NetworkCredential Class
          10. Asynchronous Web Requests
          11. Making Network Requests via a Proxy Server
        3. Determining Whether the Device Is Connected
        4. Working with Sockets
          1. Understanding Your IP Network While Using the Emulators and ActiveSync
          2. Performing DNS Lookups
          3. Using System.Net.Sockets.TcpListener
          4. Using System.Net.Sockets.TcpClient
          5. Using System.Net.Sockets.UdpClient
          6. Using the Socket Class
            1. Using Sockets for Synchronous Operations
            2. Using Sockets for Asynchronous Operations
            3. Handling Errors with Sockets
          7. Infrared Communications
            1. Discovering InfraRed Devices with IrDAClient.DiscoverDevices
            2. Listening for Infrared Connections with IrDAListener
            3. Making Infrared Connections with IrDAClient
        5. Serial Communications
        6. Summary
      6. 12. .NET Compact Framework Application Security
        1. Considering the Basics of Handheld Device Security
          1. Contemplating User Authentication
          2. Using Antivirus Software
          3. Employing Firewalls
        2. Securing Wireless Data Transmission
          1. Using Virtual Private Networking
          2. Using SSL
          3. Preventing Spoofing
        3. Authenticating and Authorizing Mobile Clients
          1. Supplying Logon Credentials in .NET Compact Framework Applications
          2. Giving Mobile Users Appropriate Authorization
        4. Securing XML Web Services
          1. Using Custom Authentication with SOAP Headers
        5. Securing SQL Server CE Connectivity
        6. Securing Data on the Device
          1. Using Cryptography on a Handheld Device
          2. Securing SQL Server CE Databases
        7. Programming .NET Compact Framework Security
          1. Understanding the .NET Compact Framework Security Policy
          2. Employing Secure Coding Practices
          3. Storing User Names and Passwords in Code
          4. Avoiding Malicious Downloads
        8. Summary
    9. IV. Connecting with Data
      1. 13. Accessing Data
        1. Caching, Replicating, and Resolving Conflicts
          1. Caching
          2. Employing Change Replication
          3. Dealing with Conflict Resolution
        2. Avoiding Replication
        3. Synchronizing Data in Mostly Disconnected Solutions
          1. Synchronizing with ActiveSync File Replication
          2. Synchronizing with SQL Server CE RDA
          3. Synchronizing with SQL Server 2000 Merge Replication
        4. Synchronizing Data in Mostly Connected Solutions
          1. Accessing SQL Server 2000 Directly
          2. Implementing Mobile Web Applications
          3. Using Web Services
        5. Employing Other Network Solutions
          1. Working with Sockets
          2. Exploiting Infrared Light
        6. Summary
      2. 14. ADO.NET Data Objects
        1. Recognizing the Advantages of ADO.NET
          1. ADO.NET Is Connectionless
          2. ADO.NET Is Centered on XML
          3. ADO.NET Enables Data Binding
        2. Introducing the ADO.NET Objects
          1. Understanding the DataSet Object
          2. Representing Data Tables
          3. Defining Relations with the DataRelation Object
          4. Understanding the DataView Object
        3. Building a DataSet Object from Scratch
          1. Adding the DataSet, DataTable, and DataColumn Objects
          2. Adding DataRow Objects
          3. Reading, Updating, or Deleting a DataRow Object
          4. Finding a DataRow Object
          5. Viewing the XML Representation of a DataSet Object
          6. Using Typed DataSet Objects
          7. Creating a DataSet Object with the DataSet Designer
          8. Loading a Saved Schema
        4. Using Multitable DataSet Objects
          1. Defining Relations in a Multitable DataSet Object
            1. Adding a Relation with XML Schema Designer
            2. Adding the Relation in Code
            3. Navigating the Relation in Code
          2. Setting Constraints in a DataRelation Object
        5. Saving a DataSet Object Locally
          1. Writing the Data
          2. Reading the Data
          3. Putting It All Together
        6. Working with Updates, Data Views, and Data Binding
          1. Tracking DataSet Updates
            1. Understanding Row States
            2. Understanding Row Versions
          2. Working with the DataView Object
            1. Using the Sort Property
            2. Using the RowFilter Property
            3. Using the RowStateFilter Property
            4. Commiting Changes
          3. Examining Data Binding
            1. Understanding Simple Data Binding
            2. Understanding Complex Data Binding
            3. Creating Data Bindings in Code
            4. Working with Default Data Views
            5. Tracking the Current Row in a DataGrid
            6. Implementing a Data Binding Sample
        7. Summary
      3. 15. Integrating Data with SQL Server
        1. Examining Data Access Architecture
          1. Using the SQL Server 2000 Managed Provider
          2. Understanding Differences from the Desktop .NET Framework
            1. Using Forms Designer
            2. Implementing Transactions
            3. Establishing Connections
          3. Introducing the System.Data.SqlClient Namespace
            1. Introducing the SqlConnection Object
            2. Introducing the SqlCommand Object
            3. Introducing the SqlParameter Object
            4. Introducing the SqlDataReader Object
            5. Introducing the SqlDataAdapter Object
            6. Introducing the SqlCommandBuilder Object
            7. Introducing the SqlException and SqlError Objects
        2. Retrieving Data
          1. Creating a SqlConnection Object
            1. Connecting to an Instance of SQL Server
            2. Specifying Security Options
          2. Using the SqlCommand Object
          3. Using the SqlDataReader Object
          4. Using the SqlException Object
        3. Binding Data
          1. Using the DataSet and SqlDataAdapter Objects
        4. Updating Data
          1. Updating Bound Data
          2. Using SqlCommandBuilder
          3. Handling the Update Process
            1. Handling Update Events
          4. Handling Update Exceptions
        5. Using SQL Server Stored Procedures
          1. Using Transactions in the .NET Compact Framework
          2. Using Stored Procedures That Get Data
            1. Returning Result Sets
            2. Returning Scalars
            3. Returning Multiple Result Sets
          3. Using Stored Procedures with Parameters
            1. Creating Input Parameters
            2. Creating Output Parameters
            3. Accessing Return Values
          4. Executing Stored Procedures That Do Not Return Data
        6. SQLXML
          1. Using SQLXML in an Application
          2. Further Reading
        7. Summary
      4. 16. Working with XML Web Services
        1. XML Web Services Architecture
        2. XML Web Services Infrastructure
          1. XML Web Services Directories
          2. XML Web Services Discovery
          3. XML Web Services Description
          4. XML Web Services Wire Formats
        3. Outline of an XML Web Service at Work
          1. The XML Web Service Client
          2. The Web Service at Run Time
        4. Compact Framework Limitations
        5. A Simple XML Web Service
        6. A Client for the Simple XML Web Service
          1. Web Reference
          2. Proxy Generation
          3. Proxy Class Allows Dynamic Web Service URL
          4. XML Web Service Consumption
        7. A Web Service That Returns a Dataset
          1. The TimesheetService Web Service
          2. An XML Web Service Client with a Typed Dataset
          3. Techniques for Changing a Web Service to Use Standard Datasets
          4. Web Service Client with a Standard Dataset
          5. Asynchronous Operation
        8. Procedure for Returning a Dataset for Update
        9. Design Considerations for XML Web Services
        10. Summary
      5. 17. Using SQL Server CE
        1. Using SQL Server on a Smart Device
          1. Getting Data to and from SQL Server
        2. Programming a SQL Server CE Application
          1. Introducing SqlServerCe Data Programming Objects
            1. Creating a Local Database in Code
            2. Adding Data Using SQL
          2. Retrieving Data Rows
            1. Using the SqlCeDataReader Class
            2. Using a Dataset and Data Binding
            3. Using the SqlCeCommand Object with Parameters
            4. Updating with Data Binding
        3. Programming Remote Data Access
          1. Introducing RDA Architecture
          2. Installing RDA Server
            1. Installing the SQL Server CE Server Agent
            2. Configuring RDA Security
          3. Pulling Data into a Local Database
            1. Using RDA Pull
            2. Tracking Options
            3. Understanding RDA Pull Data Type Conversions
            4. Making Changes to a Pulled Table
          4. Pushing Changes Back to the Remote Database
            1. Using Optimistic Concurrency
            2. Using the Push method
            3. Examining the RDA Errors Table
          5. Running Commands on the Remote Database
          6. Troubleshooting RDA
        4. Using Merge Replication
          1. Introducing Merge Replication Architecture
          2. Setting Up Merge Replication
            1. Setting Up the Publication
            2. Setting Up the Web Server
            3. Understanding Merge Replication Security
          3. Programming Merge Replication
            1. Adding a Subscription
            2. Synchronizing Data
            3. Troubleshooting Merge Replication
        5. Choosing Between RDA and Merge Replication
        6. Summary
    10. V. Advanced Mobile Application Development
      1. 18. Custom Controls
        1. Inheriting from a Toolbox Control
        2. Inheriting from the Control Class
          1. Creating a Clickable Label Control
        3. Adding Custom Events: SlideShow
          1. Adding a Custom Event to the Control
          2. Enhancing the SlideShow Control with a Timer
        4. Placing a Custom Control in Its Own Assembly
        5. Creating a Component
        6. Creating a Design-Time Custom Control
          1. Creating a Designer Version of a Custom Control
            1. Differences Between the Full .NET Framework and the .NET Compact Framework
            2. Connecting the Design-Time Assembly to the .NET Compact Framework Runtime
            3. Specifying a Designer for the Class
            4. Building and Deploying the Design-Time Control
            5. Adding the Control to the Toolbox
        7. Summary
      2. 19. Globalization and Localization
        1. Cultures and the CultureInfo Class
          1. The CultureInfo Class
            1. Determining the Current Culture
            2. Creating a New CultureInfo Instance
        2. Data for Specific Cultures
          1. Numbers for Specific Cultures
          2. Culturally Aware String Comparisons
          3. Date and Time Values for Specific Cultures
            1. Handling Time Zones
            2. Using Alternative Calendars
        3. Character Encoding
        4. Localized Resource Files
          1. Localized Resource Creation
          2. Localized Resource Retrieval
        5. Summary
      3. 20. Multithreading
        1. Understanding Multithreading
          1. Understanding the Advantages of Multithreading
          2. Avoiding Pitfalls in Multithreading
        2. Scheduling
        3. Creating a Multithreaded Application
          1. Constructing a new Thread Object
          2. Putting a Thread to Sleep
          3. Using Timers
          4. Using Thread Pools
        4. Synchronizing Threads and Thread Safety
          1. Determining What Memory Is Used by Threads
          2. Understanding Thread Safety
          3. Exploring Synchronization Features of the .NET Compact Framework
            1. Using the Monitor Class
            2. Using the Mutex Class
            3. Using the ManualResetEvent and AutoResetEvent Classes
            4. Using the Interlocked Class
          4. Avoiding Deadlocks
          5. Creating Thread-Safe Wrappers
        5. Using Multithreading with Controls
        6. Comparing the Two Frameworks
          1. Setting Thread Priorities
          2. Using the Join Method
          3. Using the Suspend and Resume Methods
          4. Using Application Domains
          5. Using the Thread Class’s Abort and Interrupt Methods
          6. Using the ReaderWriterLock Class
          7. Employing Background Threads
          8. Using the SynchronizationAttribute Class
        7. Summary
      4. 21. Graphics Programming
        1. Classes for Graphics Programming
        2. Classes Used to Draw Shapes, Bitmaps, and Text
          1. The Pen Class
          2. The SolidBrush Class
          3. The Color Class
          4. The Font Class
          5. The Icon Class
          6. The Bitmap Class
          7. The Point Structure
          8. The Rectangle Structure
          9. The Region Class
        3. Graphics Class Drawing Methods
          1. The DrawImage Method
          2. The DrawIcon Method
          3. The FillRegion Method
          4. The DrawRectangle and FillRectangle Methods
          5. The DrawLine Method
          6. The DrawString Method
          7. The DrawEllipse and FillEllipse Methods
          8. The DrawPolygon and FillPolygon Methods
        4. The OnPaint Method
        5. Summary
      5. 22. Interoperating with Native Code
        1. Understanding Managed and Unmanaged Code
        2. Writing Custom Unmanaged DLLs
          1. Choosing an eMbedded Visual C++ 4 Project Type
          2. Specifying Processor-Specific Options
          3. Dealing with C++ Name Mangling
          4. Exporting Entry Points
          5. Using DUMPBIN to Determine Entry Points
          6. Deploying Unmanaged DLLs
          7. Ensuring Compatibility with Different Windows CE Versions
        3. Using P/Invoke
          1. Declaring an Unmanaged Code Function
          2. Declaring Unmanaged Code Functions Using C#
          3. Declaring Unmanaged Code Functions Using Visual Basic .NET
          4. Calling the Unmanaged Code Function
          5. Handling Run-Time Errors
          6. Dealing with Special Cases: The EntryPoint Property
          7. Marshaling Parameters
          8. Marshaling Value and Reference Types
          9. Passing Value Parameters
          10. Marshaling Alternative Types
          11. Using Directional Attributes
          12. Working with Symbolic Constants and Enumerated Types
          13. Processing Reference Types
          14. Passing Arrays
          15. Passing String and StringBuilder Variables
          16. Passing Structures and Classes
          17. Marshaling More Complex Structures
          18. Calling Conventions
          19. Using Callbacks and Delegates
          20. Marshaling DateTime Objects
        4. Calling the Windows CE API
          1. Retrieving Windows Error Codes
          2. Understanding the MessageWindow Component
            1. Using MessageWindow and Sending Messages
            2. Calling from Unmanaged Code to Managed Code
          3. Intercepting Messages Using MessageWindow
        5. Calling COM Objects
        6. Using Wrapper Functions for COM Objects
          1. Developing a Simple COM Wrapper
          2. Maintaining State with a COM Wrapper
        7. Summary
      6. 23. Migrating eMbedded Visual Tools Applications and Cross-Framework Development
        1. Migrating eMbedded Visual Tools Applications
          1. Binary Compatibility
          2. Language Changes
          3. User Interface Programming Model
          4. ActiveX Controls
          5. User Interface and Business Logic Decoupled
          6. Transitional Arrangements
          7. Databases
          8. COM Interoperability
        2. Writing Cross-Framework Applications
          1. Retargetable Assemblies
          2. Run-Time Determination of the Operating System
          3. Conditional Compilation
        3. Summary
    11. A. .NET Compact Framework Base Class Libraries
      1. Microsoft.VisualBasic Namespace
      2. Microsoft.WindowsCE.Forms Namespace
      3. System Namespace
      4. System.CodeDom Namespace
      5. System.Collections Namespace
      6. System.Collections.Specialized Namespace
      7. System.ComponentModel Namespace
      8. System.ComponentModel.Design Namespace
      9. System.Configuration.* Namespaces
      10. System.Data Namespace
      11. System.Data.Common Namespace
      12. System.Data.Odbc Namespace
      13. System.Data.OleDb Namespace
      14. System.Data.SqlClient Namespace
      15. System.Data.SqlServerCe Namespace
      16. System.Data.SqlTypes Namespace
      17. System.Diagnostics Namespace
      18. System.DirectoryServices Namespace
      19. System.Drawing Namespace
      20. System.Drawing.Design Namespace
      21. System.Drawing.Drawing2D Namespace
      22. System.Drawing.Imaging Namespace
      23. System.Drawing.Printing Namespace
      24. System.Drawing.Text Namespace
      25. System.EnterpriseServices Namespaces
      26. System.Globalization Namespace
      27. System.IO Namespace
      28. System.Management Namespaces
      29. System.Messaging Namespace
      30. System.Net Namespace
      31. System.Net.Sockets Namespace
      32. System.Reflection Namespace
      33. System.Resources Namespace
      34. System.Runtime.CompilerServices Namespace
      35. System.Runtime.InteropServices Namespace
      36. System.Runtime.Remoting Namespaces
      37. System.Runtime.Serialization Namespaces
      38. System.Security Namespace
      39. System.Security.Cryptography.X509Certificates Namespace
      40. System.Security.Permissions Namespace
      41. System.Security.Policy Namespace
      42. System.ServiceProcess Namespace
      43. System.Text Namespace
      44. System.Text.RegularExpressions Namespace
      45. System.Threading Namespace
      46. System.Timers Namespace
      47. System.Web Namespaces
      48. System.Web.Services Namespace
      49. System.Web.Services.Description Namespace
      50. System.Web.Services.Protocols Namespace
      51. System.Windows.Forms Namespace
      52. System.Windows.Forms.Design Namespace
      53. System.Xml Namespace
      54. System.Xml.Schema Namespace
      55. System.Xml.Serialization Namespace
      56. System.Xml.XPath Namespace
      57. System.Xml.Xsl Namespace
    12. B. About the Author
    13. SPECIAL OFFER: Upgrade this ebook with O’Reilly

Product information

  • Title: Microsoft® .NET Compact Framework (Core Reference)
  • Author(s):
  • Release date: January 2003
  • Publisher(s): Microsoft Press
  • ISBN: 9780735617254