NotCondition.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 / UIAutomation / UIAutomationClient / System / Windows / Automation / NotCondition.cs / 1305600 / NotCondition.cs

                            //---------------------------------------------------------------------------- 
//
// 
//    Copyright (C) Microsoft Corporation.  All rights reserved.
//  
//
// 
// Description: 
//
// History: 
//  10/14/2003 : BrendanM - Created
//
//---------------------------------------------------------------------------
 
using System;
using MS.Internal.Automation; 
using System.Windows.Automation; 

namespace System.Windows.Automation 
{
    /// 
    /// Condition that checks whether a pattern is currently present for a LogicalElement
    ///  
#if (INTERNAL_COMPILE)
    internal class NotCondition : Condition 
#else 
    public class NotCondition : Condition
#endif 
    {
        //-----------------------------------------------------
        //
        //  Constructors 
        //
        //----------------------------------------------------- 
 
        #region Constructors
 
        /// 
        /// Constructor to create a condition that negates the specified condition
        /// 
        /// Condition to negate 
        public NotCondition( Condition condition )
        { 
            Misc.ValidateArgumentNonNull( condition, "condition" ); 

            _condition = condition; 

            // DangerousGetHandle() reminds us that the IntPtr we get back could be collected/released/recycled. We're safe here,
            // because the Conditions are structured in a tree, with the root one (which gets passed to the Uia API) keeping all
            // others - and their associated data - alive. (Recycling isn't an issue as these are immutable classes.) 
            SetMarshalData(new UiaCoreApi.UiaNotCondition(_condition._safeHandle.DangerousGetHandle()));
        } 
 
        #endregion Constructors
 

        //------------------------------------------------------
        //
        //  Public Properties 
        //
        //----------------------------------------------------- 
 
        #region Public Properties
 
        /// 
        /// Returns the sub condition that this condition is negating.
        /// 
        public Condition Condition 
        {
            get 
            { 
                return _condition;
            } 
        }

        #endregion Public Properties
 

        //------------------------------------------------------ 
        // 
        //  Private Fields
        // 
        //------------------------------------------------------

        #region Private Fields
 
        Condition _condition;
 
        #endregion Private Fields 
    }
} 

// 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: 
//
// History: 
//  10/14/2003 : BrendanM - Created
//
//---------------------------------------------------------------------------
 
using System;
using MS.Internal.Automation; 
using System.Windows.Automation; 

namespace System.Windows.Automation 
{
    /// 
    /// Condition that checks whether a pattern is currently present for a LogicalElement
    ///  
#if (INTERNAL_COMPILE)
    internal class NotCondition : Condition 
#else 
    public class NotCondition : Condition
#endif 
    {
        //-----------------------------------------------------
        //
        //  Constructors 
        //
        //----------------------------------------------------- 
 
        #region Constructors
 
        /// 
        /// Constructor to create a condition that negates the specified condition
        /// 
        /// Condition to negate 
        public NotCondition( Condition condition )
        { 
            Misc.ValidateArgumentNonNull( condition, "condition" ); 

            _condition = condition; 

            // DangerousGetHandle() reminds us that the IntPtr we get back could be collected/released/recycled. We're safe here,
            // because the Conditions are structured in a tree, with the root one (which gets passed to the Uia API) keeping all
            // others - and their associated data - alive. (Recycling isn't an issue as these are immutable classes.) 
            SetMarshalData(new UiaCoreApi.UiaNotCondition(_condition._safeHandle.DangerousGetHandle()));
        } 
 
        #endregion Constructors
 

        //------------------------------------------------------
        //
        //  Public Properties 
        //
        //----------------------------------------------------- 
 
        #region Public Properties
 
        /// 
        /// Returns the sub condition that this condition is negating.
        /// 
        public Condition Condition 
        {
            get 
            { 
                return _condition;
            } 
        }

        #endregion Public Properties
 

        //------------------------------------------------------ 
        // 
        //  Private Fields
        // 
        //------------------------------------------------------

        #region Private Fields
 
        Condition _condition;
 
        #endregion Private Fields 
    }
} 

// 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