Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / SrgsCompiler / CfgArc.cs / 1 / CfgArc.cs
//----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
//
//
// Description:
// SAPI respresentation for an Arc in a CFG file
//
// History:
// 5/1/2004 jeanfp Created from the Sapi Managed code
//---------------------------------------------------------------------------
using System;
using System.Globalization;
using System.Speech.Internal.SrgsParser;
namespace System.Speech.Internal.SrgsCompiler
{
///
/// Summary description for CfgArc.
///
internal struct CfgArc
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
internal CfgArc (CfgArc arc)
{
_flag1 = arc._flag1;
_flag2 = arc._flag2;
}
#endregion
//********************************************************************
//
// Internal Properties
//
//*******************************************************************
#region Internal Properties
internal bool RuleRef
{
get
{
return ((_flag1 & 0x1) != 0);
}
set
{
if (value)
{
_flag1 |= 0x1;
}
else
{
_flag1 &= ~0x1U;
}
}
}
internal bool LastArc
{
get
{
return ((_flag1 & 0x2) != 0);
}
set
{
if (value)
{
_flag1 |= 0x2;
}
else
{
_flag1 &= ~0x2U;
}
}
}
internal bool HasSemanticTag
{
get
{
return ((_flag1 & 0x4) != 0);
}
set
{
if (value)
{
_flag1 |= 0x4;
}
else
{
_flag1 &= ~0x4U;
}
}
}
internal bool LowConfRequired
{
get
{
return ((_flag1 & 0x8) != 0);
}
set
{
if (value)
{
_flag1 |= 0x8;
}
else
{
_flag1 &= ~0x8U;
}
}
}
internal bool HighConfRequired
{
get
{
return ((_flag1 & 0x10) != 0);
}
set
{
if (value)
{
_flag1 |= 0x10;
}
else
{
_flag1 &= ~0x10U;
}
}
}
internal uint TransitionIndex
{
get
{
return (_flag1 >> 5) & 0x3FFFFF;
}
set
{
if (value > 0x3FFFFFU)
{
XmlParser.ThrowSrgsException (SRID.TooManyArcs);
}
_flag1 &= ~(0x3FFFFFU << 5);
_flag1 |= value << 5;
}
}
internal uint MatchMode
{
set
{
_flag1 &= ~(0x38000000U);
_flag1 |= value << 27;
}
#if CFGDUMP || VSCOMPILE
get
{
return (_flag1 >> 27) & 0x7;
}
#endif
}
// internal uint Weight
// {
// get
// {
// return _flag2 & 0xFF;
// }
// set
// {
// if (value > 0xFF)
// {
// throw new OverflowException (SR.Get (SRID.TooManyArcs));
// }
//
// _flag2 &= ~(uint) 0xFF;
// _flag2 |= value;
// }
// }
//
internal uint NextStartArcIndex
{
get
{
return (_flag2 >> 8) & 0x3FFFFF;
}
set
{
if (value > 0x3FFFFF)
{
XmlParser.ThrowSrgsException (SRID.TooManyArcs);
}
_flag2 &= ~(0x3FFFFFU << 8);
_flag2 |= value << 8;
}
}
#if false
internal string DumpFlags
{
get
{
return string.Format (CultureInfo.InvariantCulture, "flag1: {0:x} flag2: {1:x}", _flag1, _flag2);
}
}
#endif
#endregion
//********************************************************************
//
// Private Fields
//
//********************************************************************
#region private Fields
private uint _flag1;
private uint _flag2;
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
//
//
// Description:
// SAPI respresentation for an Arc in a CFG file
//
// History:
// 5/1/2004 jeanfp Created from the Sapi Managed code
//---------------------------------------------------------------------------
using System;
using System.Globalization;
using System.Speech.Internal.SrgsParser;
namespace System.Speech.Internal.SrgsCompiler
{
///
/// Summary description for CfgArc.
///
internal struct CfgArc
{
//*******************************************************************
//
// Constructors
//
//*******************************************************************
#region Constructors
internal CfgArc (CfgArc arc)
{
_flag1 = arc._flag1;
_flag2 = arc._flag2;
}
#endregion
//********************************************************************
//
// Internal Properties
//
//*******************************************************************
#region Internal Properties
internal bool RuleRef
{
get
{
return ((_flag1 & 0x1) != 0);
}
set
{
if (value)
{
_flag1 |= 0x1;
}
else
{
_flag1 &= ~0x1U;
}
}
}
internal bool LastArc
{
get
{
return ((_flag1 & 0x2) != 0);
}
set
{
if (value)
{
_flag1 |= 0x2;
}
else
{
_flag1 &= ~0x2U;
}
}
}
internal bool HasSemanticTag
{
get
{
return ((_flag1 & 0x4) != 0);
}
set
{
if (value)
{
_flag1 |= 0x4;
}
else
{
_flag1 &= ~0x4U;
}
}
}
internal bool LowConfRequired
{
get
{
return ((_flag1 & 0x8) != 0);
}
set
{
if (value)
{
_flag1 |= 0x8;
}
else
{
_flag1 &= ~0x8U;
}
}
}
internal bool HighConfRequired
{
get
{
return ((_flag1 & 0x10) != 0);
}
set
{
if (value)
{
_flag1 |= 0x10;
}
else
{
_flag1 &= ~0x10U;
}
}
}
internal uint TransitionIndex
{
get
{
return (_flag1 >> 5) & 0x3FFFFF;
}
set
{
if (value > 0x3FFFFFU)
{
XmlParser.ThrowSrgsException (SRID.TooManyArcs);
}
_flag1 &= ~(0x3FFFFFU << 5);
_flag1 |= value << 5;
}
}
internal uint MatchMode
{
set
{
_flag1 &= ~(0x38000000U);
_flag1 |= value << 27;
}
#if CFGDUMP || VSCOMPILE
get
{
return (_flag1 >> 27) & 0x7;
}
#endif
}
// internal uint Weight
// {
// get
// {
// return _flag2 & 0xFF;
// }
// set
// {
// if (value > 0xFF)
// {
// throw new OverflowException (SR.Get (SRID.TooManyArcs));
// }
//
// _flag2 &= ~(uint) 0xFF;
// _flag2 |= value;
// }
// }
//
internal uint NextStartArcIndex
{
get
{
return (_flag2 >> 8) & 0x3FFFFF;
}
set
{
if (value > 0x3FFFFF)
{
XmlParser.ThrowSrgsException (SRID.TooManyArcs);
}
_flag2 &= ~(0x3FFFFFU << 8);
_flag2 |= value << 8;
}
}
#if false
internal string DumpFlags
{
get
{
return string.Format (CultureInfo.InvariantCulture, "flag1: {0:x} flag2: {1:x}", _flag1, _flag2);
}
}
#endif
#endregion
//********************************************************************
//
// Private Fields
//
//********************************************************************
#region private Fields
private uint _flag1;
private uint _flag2;
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SerializationInfoEnumerator.cs
- EmptyEnumerator.cs
- XmlSchemaAnnotated.cs
- MemoryMappedViewStream.cs
- Util.cs
- InvalidCastException.cs
- ReferentialConstraint.cs
- ImpersonationContext.cs
- ClonableStack.cs
- TdsParserStateObject.cs
- MembershipValidatePasswordEventArgs.cs
- ClientSideQueueItem.cs
- DictionaryEntry.cs
- Int32Animation.cs
- EncodingNLS.cs
- TextEditorThreadLocalStore.cs
- SoapMessage.cs
- StringUtil.cs
- QilTargetType.cs
- NameSpaceEvent.cs
- EncoderParameter.cs
- SecurityTokenSerializer.cs
- ProxyGenerationError.cs
- Style.cs
- EventItfInfo.cs
- TableLayoutPanelBehavior.cs
- NetworkStream.cs
- SplitterCancelEvent.cs
- DateTimeFormat.cs
- ArrayTypeMismatchException.cs
- DataGridViewTopRowAccessibleObject.cs
- WSDualHttpSecurityMode.cs
- SystemDropShadowChrome.cs
- QuaternionRotation3D.cs
- GenericEnumConverter.cs
- InkPresenterAutomationPeer.cs
- XmlElementList.cs
- CounterCreationDataCollection.cs
- MessagePartProtectionMode.cs
- RequestReplyCorrelator.cs
- TypeSource.cs
- ContextBase.cs
- ValidationContext.cs
- AssociationProvider.cs
- XmlNodeList.cs
- CrossAppDomainChannel.cs
- ResourceLoader.cs
- PeerApplicationLaunchInfo.cs
- PrincipalPermission.cs
- BreakRecordTable.cs
- WebControlParameterProxy.cs
- DataSourceExpressionCollection.cs
- RNGCryptoServiceProvider.cs
- SecurityChannelListener.cs
- DataGridCellItemAutomationPeer.cs
- MessageDescription.cs
- WindowsRebar.cs
- WindowsAuthenticationModule.cs
- RoleServiceManager.cs
- _SafeNetHandles.cs
- VectorConverter.cs
- X509Certificate.cs
- CounterCreationData.cs
- DataGridViewColumnCollection.cs
- CustomValidator.cs
- WebFormDesignerActionService.cs
- MouseWheelEventArgs.cs
- PolyLineSegmentFigureLogic.cs
- TraceInternal.cs
- Interlocked.cs
- SimplePropertyEntry.cs
- ListBox.cs
- ReferenceService.cs
- BindToObject.cs
- PackWebRequest.cs
- BufferedStream2.cs
- ContextBase.cs
- ThicknessAnimationUsingKeyFrames.cs
- SafePointer.cs
- CellConstant.cs
- AvTraceDetails.cs
- HandoffBehavior.cs
- ExpandCollapsePattern.cs
- EndpointDispatcher.cs
- CodeTypeReferenceCollection.cs
- HitTestFilterBehavior.cs
- Command.cs
- XmlNodeChangedEventManager.cs
- QueryContinueDragEvent.cs
- WindowsListBox.cs
- ImageMetadata.cs
- ToggleButton.cs
- Point3DAnimationUsingKeyFrames.cs
- Types.cs
- HuffmanTree.cs
- TempFiles.cs
- DaylightTime.cs
- OleDbErrorCollection.cs
- GACMembershipCondition.cs
- FtpCachePolicyElement.cs