Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Recognition / SrgsGrammar / SrgsSemanticInterpretationTag.cs / 1 / SrgsSemanticInterpretationTag.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: // // History: // 5/1/2004 [....] Created from the Kurosawa Code //--------------------------------------------------------------------------- using System; using System.Diagnostics; using System.Speech.Internal; using System.Speech.Internal.SrgsParser; using System.Text; using System.Xml; #pragma warning disable 1634, 1691 // Allows suppression of certain PreSharp messages. namespace System.Speech.Recognition.SrgsGrammar { /// TODOC <_include file='doc\Tag.uex' path='docs/doc[@for="Tag"]/*' /> [Serializable] [DebuggerDisplay ("{DebuggerDisplayString ()}")] public class SrgsSemanticInterpretationTag : SrgsElement, ISemanticTag { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors /// TODOC <_include file='doc\Tag.uex' path='docs/doc[@for="Tag.Tag1"]/*' /> public SrgsSemanticInterpretationTag () { } #pragma warning disable 56507 /// TODOC <_include file='doc\Tag.uex' path='docs/doc[@for="Tag.Tag2"]/*' /> public SrgsSemanticInterpretationTag (string script) { Helpers.ThrowIfNull (script, "script"); _script = script; } #endregion //******************************************************************** // // Public Properties // //******************************************************************* #region public Properties /// TODOC <_include file='doc\Tag.uex' path='docs/doc[@for="Tag.Script"]/*' /> public string Script { get { return _script; } set { Helpers.ThrowIfNull (value, "value"); _script = value; } } #pragma warning restore 56507 #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods // Validate the SRGS element. ////// Validate each element and recurse through all the children srgs /// elements if any. /// override internal void Validate (SrgsGrammar grammar) { if (grammar.TagFormat == SrgsTagFormat.Default) { grammar.TagFormat |= SrgsTagFormat.W3cV1; } else if (grammar.TagFormat == SrgsTagFormat.KeyValuePairs) { XmlParser.ThrowSrgsException (SRID.SapiPropertiesAndSemantics); } } internal override void WriteSrgs (XmlWriter writer) { // Skip writing the tag if empty string script = Script.Trim (Helpers._achTrimChars); // Writescript writer.WriteStartElement ("tag"); // Write the script if any if (!string.IsNullOrEmpty(script)) { writer.WriteString (script); } writer.WriteEndElement (); } internal override string DebuggerDisplayString () { StringBuilder sb = new StringBuilder ("SrgsSemanticInterpretationTag '"); sb.Append (_script); sb.Append ("'"); return sb.ToString (); } void ISemanticTag.Content (IElement parent, string value, int line) { Script = value; } #endregion //******************************************************************* // // Private Fields // //******************************************************************** #region Private Fields private string _script = string.Empty; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NavigateEvent.cs
- HttpStaticObjectsCollectionBase.cs
- DataRelation.cs
- _AutoWebProxyScriptEngine.cs
- XmlSchemaAttributeGroupRef.cs
- Repeater.cs
- DataGridViewTextBoxCell.cs
- EntityObject.cs
- DesignerForm.cs
- relpropertyhelper.cs
- StringDictionaryWithComparer.cs
- StreamMarshaler.cs
- TextCharacters.cs
- ItemType.cs
- RootDesignerSerializerAttribute.cs
- PerformanceCountersElement.cs
- RecommendedAsConfigurableAttribute.cs
- WebZone.cs
- _NegotiateClient.cs
- ColorConvertedBitmap.cs
- HttpHandlerAction.cs
- InputProviderSite.cs
- AsyncPostBackErrorEventArgs.cs
- HostProtectionPermission.cs
- RegexBoyerMoore.cs
- unsafeIndexingFilterStream.cs
- _SafeNetHandles.cs
- NetTcpSection.cs
- XPathPatternBuilder.cs
- Ref.cs
- CustomValidator.cs
- RIPEMD160Managed.cs
- TraceRecords.cs
- SessionPageStateSection.cs
- CodeCatchClause.cs
- ToolStripItem.cs
- RelOps.cs
- SettingsPropertyValue.cs
- DivideByZeroException.cs
- XmlReflectionMember.cs
- SerialPort.cs
- DataViewSetting.cs
- SystemColorTracker.cs
- DBSchemaRow.cs
- JoinSymbol.cs
- QilSortKey.cs
- CompositeKey.cs
- compensatingcollection.cs
- HttpRuntimeSection.cs
- SortedList.cs
- ValueTypeFixupInfo.cs
- QuotedPrintableStream.cs
- PolicyValidationException.cs
- UncommonField.cs
- InstanceData.cs
- TextOutput.cs
- OrderedDictionary.cs
- BufferedMessageData.cs
- RuleRef.cs
- AddingNewEventArgs.cs
- XamlVector3DCollectionSerializer.cs
- StateChangeEvent.cs
- StickyNote.cs
- WizardDesigner.cs
- RegisteredScript.cs
- X509SubjectKeyIdentifierClause.cs
- VisualStateGroup.cs
- WebHostScriptMappingsInstallComponent.cs
- MessageDescriptionCollection.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- ProfileInfo.cs
- XmlILConstructAnalyzer.cs
- XmlSchemaSimpleContentRestriction.cs
- RijndaelManagedTransform.cs
- QualificationDataItem.cs
- FieldBuilder.cs
- AnimationClock.cs
- XmlBindingWorker.cs
- StructuralType.cs
- IdentityHolder.cs
- QilReplaceVisitor.cs
- SettingsPropertyCollection.cs
- HttpProfileGroupBase.cs
- ProxyHwnd.cs
- ImportException.cs
- TreeBuilder.cs
- ConditionalAttribute.cs
- SQLGuid.cs
- WebPartsPersonalization.cs
- _DynamicWinsockMethods.cs
- BitmapEffectDrawingContextWalker.cs
- DBBindings.cs
- BulletedList.cs
- XhtmlBasicCommandAdapter.cs
- BmpBitmapEncoder.cs
- UIAgentCrashedException.cs
- ClientSponsor.cs
- SourceItem.cs
- ComplexPropertyEntry.cs
- GlyphRunDrawing.cs