SemanticResultKey.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Recognition / SemanticResultKey.cs / 1 / SemanticResultKey.cs

                            //------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------- 

using System.Collections.Generic; 
using System.Diagnostics; 
using System.Speech.Internal.GrammarBuilding;
using System.Speech.Internal; 

namespace System.Speech.Recognition
{
    ///  
    ///
    ///  
 
    [DebuggerDisplay ("{_semanticKey.DebugSummary}")]
    public class SemanticResultKey 
    {
        //*******************************************************************
        //
        // Constructors 
        //
        //******************************************************************* 
 
        #region Constructors
 
        /// 
        ///
        /// 
        ///  
        private SemanticResultKey (string semanticResultKey)
            : base () 
        { 
            Helpers.ThrowIfEmptyOrNull (semanticResultKey, "semanticResultKey");
 
            _semanticKey = new SemanticKeyElement (semanticResultKey);
        }

        ///  
        ///
        ///  
        ///  
        /// 
        public SemanticResultKey (string semanticResultKey, params string [] phrases) 
            : this (semanticResultKey)
        {
            Helpers.ThrowIfEmptyOrNull (semanticResultKey, "semanticResultKey");
            Helpers.ThrowIfNull (phrases, "phrases"); 

            // Build a grammar builder with all the phrases 
            foreach (string phrase in phrases) 
            {
                _semanticKey.Add ((string) phrase.Clone ()); 
            }
        }

        ///  
        ///
        ///  
        ///  
        /// 
        public SemanticResultKey (string semanticResultKey, params GrammarBuilder [] builders) 
            : this (semanticResultKey)
        {
            Helpers.ThrowIfEmptyOrNull (semanticResultKey, "semanticResultKey");
            Helpers.ThrowIfNull (builders, "phrases"); 

            // Build a grammar builder with all the grammar builders 
            foreach (GrammarBuilder builder in builders) 
            {
                _semanticKey.Add (builder.Clone ()); 
            }
        }

        #endregion 

        //******************************************************************** 
        // 
        // Public Methods
        // 
        //*******************************************************************

        #region Public Methods
 
        /// 
        /// TODOC 
        ///  
        /// 
        public GrammarBuilder ToGrammarBuilder () 
        {
                return new GrammarBuilder (this);
        }
 
        #endregion
 
        //******************************************************************** 
        //
        // Internal Properties 
        //
        //********************************************************************

        #region Internal Properties 

        internal SemanticKeyElement SemanticKeyElement 
        { 
            get
            { 
                return _semanticKey;
            }
        }
 
        #endregion
 
        //******************************************************************* 
        //
        // Private Fields 
        //
        //********************************************************************

        #region Private Fields 

        private readonly SemanticKeyElement _semanticKey; 
 
        #endregion
 
    }
}

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

using System.Collections.Generic; 
using System.Diagnostics; 
using System.Speech.Internal.GrammarBuilding;
using System.Speech.Internal; 

namespace System.Speech.Recognition
{
    ///  
    ///
    ///  
 
    [DebuggerDisplay ("{_semanticKey.DebugSummary}")]
    public class SemanticResultKey 
    {
        //*******************************************************************
        //
        // Constructors 
        //
        //******************************************************************* 
 
        #region Constructors
 
        /// 
        ///
        /// 
        ///  
        private SemanticResultKey (string semanticResultKey)
            : base () 
        { 
            Helpers.ThrowIfEmptyOrNull (semanticResultKey, "semanticResultKey");
 
            _semanticKey = new SemanticKeyElement (semanticResultKey);
        }

        ///  
        ///
        ///  
        ///  
        /// 
        public SemanticResultKey (string semanticResultKey, params string [] phrases) 
            : this (semanticResultKey)
        {
            Helpers.ThrowIfEmptyOrNull (semanticResultKey, "semanticResultKey");
            Helpers.ThrowIfNull (phrases, "phrases"); 

            // Build a grammar builder with all the phrases 
            foreach (string phrase in phrases) 
            {
                _semanticKey.Add ((string) phrase.Clone ()); 
            }
        }

        ///  
        ///
        ///  
        ///  
        /// 
        public SemanticResultKey (string semanticResultKey, params GrammarBuilder [] builders) 
            : this (semanticResultKey)
        {
            Helpers.ThrowIfEmptyOrNull (semanticResultKey, "semanticResultKey");
            Helpers.ThrowIfNull (builders, "phrases"); 

            // Build a grammar builder with all the grammar builders 
            foreach (GrammarBuilder builder in builders) 
            {
                _semanticKey.Add (builder.Clone ()); 
            }
        }

        #endregion 

        //******************************************************************** 
        // 
        // Public Methods
        // 
        //*******************************************************************

        #region Public Methods
 
        /// 
        /// TODOC 
        ///  
        /// 
        public GrammarBuilder ToGrammarBuilder () 
        {
                return new GrammarBuilder (this);
        }
 
        #endregion
 
        //******************************************************************** 
        //
        // Internal Properties 
        //
        //********************************************************************

        #region Internal Properties 

        internal SemanticKeyElement SemanticKeyElement 
        { 
            get
            { 
                return _semanticKey;
            }
        }
 
        #endregion
 
        //******************************************************************* 
        //
        // Private Fields 
        //
        //********************************************************************

        #region Private Fields 

        private readonly SemanticKeyElement _semanticKey; 
 
        #endregion
 
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.

                        

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