Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / SrgsCompiler / propertytag.cs / 1 / propertytag.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Speech.Internal.SrgsParser; #pragma warning disable 1634, 1691 // Allows suppression of certain PreSharp messages. namespace System.Speech.Internal.SrgsCompiler { ////// Summary description for Rule. /// internal sealed class PropertyTag : ParseElement, IPropertyTag { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors internal PropertyTag (ParseElement parent, Backend backend) : base (parent._rule) { } #endregion //******************************************************************** // // Internal Methods // //******************************************************************* #region Internal Methods #pragma warning disable 56507 /// TODOC <_include file='doc\Tag.uex' path='docs/doc[@for="Tag.RepeatProbability"]/*' /> // The probability that this item will be repeated. void IPropertyTag.NameValue (IElement parent, string name, object value) { //Return if the Tag content is empty string sValue = value as string; if (string.IsNullOrEmpty (name) && (value == null || (sValue != null && string.IsNullOrEmpty ((sValue).Trim ())))) { return; } // Build semantic properties to attach to epsilon transition. //Name= pszValue = null vValue = VT_EMPTY //Name="string" pszValue = "string" vValue = VT_EMPTY //Name=true pszValue = null vValue = VT_BOOL //Name=123 pszValue = null vValue = VT_I4 //Name=3.14 pszValue = null vValue = VT_R8 if (!string.IsNullOrEmpty (name)) { // Set property name _propInfo._pszName = name; } else { // If no property, set the name to the anonymous property name _propInfo._pszName = "="; } // Set property value _propInfo._comValue = value; if (value == null) { _propInfo._comType = VarEnum.VT_EMPTY; } else if (sValue != null) { _propInfo._comType = VarEnum.VT_EMPTY; } else if (value is int) { _propInfo._comType = VarEnum.VT_I4; } else if (value is double) { _propInfo._comType = VarEnum.VT_R8; } else if (value is bool) { _propInfo._comType = VarEnum.VT_BOOL; } else { // should never get here System.Diagnostics.Debug.Assert (false); } } void IElement.PostParse (IElement parentElement) { ParseElementCollection parent = (ParseElementCollection) parentElement; _propInfo._ulId = (uint) parent._rule._iSerialize2; // Attach the semantic properties on the parent element. parent.AddSementicPropertyTag (_propInfo); } #pragma warning restore 56507 #endregion //******************************************************************** // // Private Fields // //******************************************************************** #region Private Fields private CfgGrammar.CfgProperty _propInfo = new CfgGrammar.CfgProperty (); #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
- BitmapEffectInput.cs
- DeviceSpecific.cs
- PropertyPathConverter.cs
- AnyReturnReader.cs
- Material.cs
- PromptBuilder.cs
- SqlConnectionHelper.cs
- UnmanagedMarshal.cs
- DataGridViewTextBoxColumn.cs
- DigestComparer.cs
- SecurityContext.cs
- SpotLight.cs
- FrugalMap.cs
- DocumentPageHost.cs
- SerializationException.cs
- ToolStripContentPanel.cs
- SelectionItemPattern.cs
- VirtualStackFrame.cs
- MobileResource.cs
- DataServiceContext.cs
- CodeAttributeDeclarationCollection.cs
- BackgroundFormatInfo.cs
- CodeDomSerializer.cs
- XmlAnyAttributeAttribute.cs
- StandardToolWindows.cs
- FileDetails.cs
- ListCollectionView.cs
- RuleSettingsCollection.cs
- ParagraphResult.cs
- LocalBuilder.cs
- CurrentTimeZone.cs
- NativeMethodsCLR.cs
- RestClientProxyHandler.cs
- MemoryPressure.cs
- GroupItemAutomationPeer.cs
- ContextMenuService.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- NetworkInformationException.cs
- FontUnit.cs
- EntityViewGenerator.cs
- GraphicsContainer.cs
- IssuanceLicense.cs
- DiscoveryRequestHandler.cs
- TemplateParser.cs
- SqlDataReader.cs
- QilUnary.cs
- DataGridViewAdvancedBorderStyle.cs
- SvcMapFileLoader.cs
- ServiceBusyException.cs
- ArithmeticException.cs
- UniformGrid.cs
- LinqDataView.cs
- FilterFactory.cs
- MemoryStream.cs
- WebSysDescriptionAttribute.cs
- TextDecorationCollectionConverter.cs
- Nodes.cs
- UTF7Encoding.cs
- StrokeCollection2.cs
- Speller.cs
- StringConverter.cs
- DialogWindow.cs
- WindowsFormsHelpers.cs
- ComboBoxItem.cs
- LinkGrep.cs
- InternalDuplexChannelFactory.cs
- ModelChangedEventArgsImpl.cs
- DesignerCategoryAttribute.cs
- TableSectionStyle.cs
- UserPreferenceChangedEventArgs.cs
- FixedTextBuilder.cs
- ExtentKey.cs
- SimpleTypesSurrogate.cs
- FullTextState.cs
- SafeRegistryKey.cs
- CachedBitmap.cs
- RemotingClientProxy.cs
- PropertyContainer.cs
- Viewport2DVisual3D.cs
- GenericFlowSwitchHelper.cs
- ComboBoxItem.cs
- ISAPIApplicationHost.cs
- XPathParser.cs
- Helpers.cs
- WrappedOptions.cs
- PropertyMapper.cs
- unsafeIndexingFilterStream.cs
- Attribute.cs
- BindStream.cs
- KeyFrames.cs
- DocumentXPathNavigator.cs
- basevalidator.cs
- DebugHandleTracker.cs
- WebProxyScriptElement.cs
- ClientEventManager.cs
- TokenBasedSetEnumerator.cs
- WorkflowValidationFailedException.cs
- ClosableStream.cs
- ADConnectionHelper.cs
- Debug.cs