TextCompositionEventArgs.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / TextCompositionEventArgs.cs / 1305600 / TextCompositionEventArgs.cs

                            //---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) Microsoft Corporation.  All rights reserved.
//  
//
// Description: TextCompositionEventArgs class 
// 
// History:
//  11/19/2003 : yutakas created 
//
//---------------------------------------------------------------------------

using System; 
namespace System.Windows.Input
{ 
    ///  
    ///     The TextCompositionEventArgs class contains a text representation of
    ///     input. 
    /// 
    public class TextCompositionEventArgs : InputEventArgs
    {
        ///  
        ///     Constructs an instance of the TextInputEventArgs class.
        ///  
        ///  
        ///     The input device to associate with this event.
        ///  
        /// 
        ///     The TextComposition object that contains the composition text and the composition state.
        /// 
        public TextCompositionEventArgs(InputDevice inputDevice, TextComposition composition) : base(inputDevice, Environment.TickCount) 
        {
            if (composition == null) 
            { 
                throw new ArgumentNullException("composition");
            } 

            _composition = composition;
        }
 
        /// 
        ///     The text composition that was provided. 
        ///  
        /// 
        public TextComposition TextComposition 
        {
            get {return _composition;}
        }
 
        /// 
        ///     The result text that was provided as input. 
        ///  
        /// 
        public string Text 
        {
            get {return _composition.Text;}
        }
 
        /// 
        ///     The result system text that was provided as input. 
        ///  
        /// 
        public string SystemText 
        {
            get {return _composition.SystemText;}
        }
 
        /// 
        ///     The result control text that was provided as input. 
        ///  
        /// 
        public string ControlText 
        {
            get {return _composition.ControlText;}
        }
 
        /// 
        ///     The mechanism used to call the type-specific handler on the 
        ///     target. 
        /// 
        ///  
        ///     The generic handler to call in a type-specific way.
        /// 
        /// 
        ///     The target to call the handler on. 
        /// 
        ///  
        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) 
        {
            TextCompositionEventHandler handler = (TextCompositionEventHandler) genericHandler; 

            handler(genericTarget, this);
        }
 
        // The target TextComposition object of this event.
        private TextComposition _composition; 
    } 
}
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) Microsoft Corporation.  All rights reserved.
//  
//
// Description: TextCompositionEventArgs class 
// 
// History:
//  11/19/2003 : yutakas created 
//
//---------------------------------------------------------------------------

using System; 
namespace System.Windows.Input
{ 
    ///  
    ///     The TextCompositionEventArgs class contains a text representation of
    ///     input. 
    /// 
    public class TextCompositionEventArgs : InputEventArgs
    {
        ///  
        ///     Constructs an instance of the TextInputEventArgs class.
        ///  
        ///  
        ///     The input device to associate with this event.
        ///  
        /// 
        ///     The TextComposition object that contains the composition text and the composition state.
        /// 
        public TextCompositionEventArgs(InputDevice inputDevice, TextComposition composition) : base(inputDevice, Environment.TickCount) 
        {
            if (composition == null) 
            { 
                throw new ArgumentNullException("composition");
            } 

            _composition = composition;
        }
 
        /// 
        ///     The text composition that was provided. 
        ///  
        /// 
        public TextComposition TextComposition 
        {
            get {return _composition;}
        }
 
        /// 
        ///     The result text that was provided as input. 
        ///  
        /// 
        public string Text 
        {
            get {return _composition.Text;}
        }
 
        /// 
        ///     The result system text that was provided as input. 
        ///  
        /// 
        public string SystemText 
        {
            get {return _composition.SystemText;}
        }
 
        /// 
        ///     The result control text that was provided as input. 
        ///  
        /// 
        public string ControlText 
        {
            get {return _composition.ControlText;}
        }
 
        /// 
        ///     The mechanism used to call the type-specific handler on the 
        ///     target. 
        /// 
        ///  
        ///     The generic handler to call in a type-specific way.
        /// 
        /// 
        ///     The target to call the handler on. 
        /// 
        ///  
        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) 
        {
            TextCompositionEventHandler handler = (TextCompositionEventHandler) genericHandler; 

            handler(genericTarget, this);
        }
 
        // The target TextComposition object of this event.
        private TextComposition _composition; 
    } 
}
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK