Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / BamlRecordHelper.cs / 1305600 / BamlRecordHelper.cs
/****************************************************************************\ * * File: BamlRecordHelper.cs * * Copyright (C) 2006 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.Diagnostics; #if PBTCOMPILER namespace MS.Internal.Markup #else using System.Windows; namespace System.Windows.Markup #endif { // Helper functions for baml records static internal class BamlRecordHelper { #if !PBTCOMPILER // // This method checks to see if the baml record type is one of the records used // to build up the map table, e.g. type information. // static internal bool IsMapTableRecordType( BamlRecordType bamlRecordType ) { switch( bamlRecordType ) { case BamlRecordType.PIMapping: case BamlRecordType.AssemblyInfo: case BamlRecordType.TypeInfo: case BamlRecordType.TypeSerializerInfo: case BamlRecordType.AttributeInfo: case BamlRecordType.StringInfo: return true; default: return false; } } internal static bool IsDebugBamlRecordType(BamlRecordType recordType) { if ( recordType == BamlRecordType.LineNumberAndPosition || recordType == BamlRecordType.LinePosition ) { return true; } return false; } // Does the given Baml Record have a Debug Baml Record in its Next link. internal static bool HasDebugExtensionRecord(bool isDebugBamlStream, BamlRecord bamlRecord) { if (isDebugBamlStream && (bamlRecord.Next != null)) { if (IsDebugBamlRecordType(bamlRecord.Next.RecordType)) { return true; } } return false; } #endif internal static bool DoesRecordTypeHaveDebugExtension(BamlRecordType recordType) { switch(recordType) { case BamlRecordType.ElementStart: case BamlRecordType.ElementEnd: case BamlRecordType.Property: case BamlRecordType.PropertyComplexStart: case BamlRecordType.PropertyArrayStart: case BamlRecordType.PropertyIListStart: case BamlRecordType.PropertyIDictionaryStart: case BamlRecordType.XmlnsProperty: case BamlRecordType.PIMapping: case BamlRecordType.PropertyTypeReference: case BamlRecordType.PropertyWithExtension: case BamlRecordType.PropertyWithConverter: case BamlRecordType.KeyElementStart: case BamlRecordType.ConnectionId: case BamlRecordType.ContentProperty: case BamlRecordType.StaticResourceStart: case BamlRecordType.PresentationOptionsAttribute: return true; case BamlRecordType.DocumentStart: case BamlRecordType.DocumentEnd: // End record case BamlRecordType.PropertyCustom: // The "custom" size of this is a problem case BamlRecordType.PropertyComplexEnd: // End record case BamlRecordType.PropertyArrayEnd: // End record case BamlRecordType.PropertyIListEnd: // End record case BamlRecordType.PropertyIDictionaryEnd: // End record case BamlRecordType.LiteralContent: // Not needed case BamlRecordType.Text: // Not needed case BamlRecordType.TextWithConverter: // Not common enough case BamlRecordType.RoutedEvent: // Not common enough case BamlRecordType.ClrEvent: // Not common enough case BamlRecordType.XmlAttribute: // Not common enough case BamlRecordType.ProcessingInstruction: // Not common enough case BamlRecordType.Comment: // Not common enough case BamlRecordType.DefTag: // Not common enough case BamlRecordType.DefAttribute: // Not common enough case BamlRecordType.EndAttributes: // Not common enough case BamlRecordType.AssemblyInfo: // Info records (in general) don't advance file position case BamlRecordType.TypeInfo: // Info records (in general) don't advance file position case BamlRecordType.TypeSerializerInfo: // Not common enough case BamlRecordType.AttributeInfo: // Info records (in general) don't advance file position case BamlRecordType.StringInfo: // Info records (in general) don't advance file position case BamlRecordType.PropertyStringReference: // Not common enough case BamlRecordType.DeferableContentStart: // This would complicate Deferable Content Size case BamlRecordType.ConstructorParametersStart: // Not Needed case BamlRecordType.ConstructorParametersEnd: // End record case BamlRecordType.ConstructorParameterType: // Not Needed case BamlRecordType.NamedElementStart: // Not common enough case BamlRecordType.TextWithId: // Not Needed case BamlRecordType.LineNumberAndPosition: // This would become recursive case BamlRecordType.LinePosition: // This would become recursive case BamlRecordType.DefAttributeKeyString: case BamlRecordType.DefAttributeKeyType: case BamlRecordType.KeyElementEnd: case BamlRecordType.StaticResourceEnd: case BamlRecordType.StaticResourceId: case BamlRecordType.OptimizedStaticResource: case BamlRecordType.PropertyWithStaticResourceId: return false; default: Debug.Assert(false, "Unhandled case in DoesRecordTypeHaveDebugExtension"); return false; } } } } // 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
- CurrentChangedEventManager.cs
- DataGridViewColumnCollectionDialog.cs
- AuthenticodeSignatureInformation.cs
- BaseAsyncResult.cs
- TimelineGroup.cs
- DocumentScope.cs
- RijndaelManagedTransform.cs
- PrtCap_Base.cs
- ProviderConnectionPoint.cs
- ScrollProperties.cs
- HwndStylusInputProvider.cs
- SystemColorTracker.cs
- ImageListImage.cs
- MenuScrollingVisibilityConverter.cs
- TableCellCollection.cs
- PseudoWebRequest.cs
- ParentQuery.cs
- Rect.cs
- BasicAsyncResult.cs
- DataGridViewHitTestInfo.cs
- mansign.cs
- TrackingProfileSerializer.cs
- ToolStripPanel.cs
- SecurityProtocol.cs
- FormattedText.cs
- log.cs
- ThemeableAttribute.cs
- BitmapSizeOptions.cs
- DocumentSchemaValidator.cs
- EditorBrowsableAttribute.cs
- EventWaitHandleSecurity.cs
- PaintEvent.cs
- StrokeNodeEnumerator.cs
- LowerCaseStringConverter.cs
- CancellationTokenRegistration.cs
- SessionKeyExpiredException.cs
- WorkflowExecutor.cs
- CompilationPass2TaskInternal.cs
- OpenFileDialog.cs
- WmpBitmapEncoder.cs
- ValueCollectionParameterReader.cs
- InputScopeAttribute.cs
- DiagnosticsConfiguration.cs
- Stack.cs
- RangeBaseAutomationPeer.cs
- LinearQuaternionKeyFrame.cs
- CodeTypeOfExpression.cs
- UpdatePanelControlTrigger.cs
- ControlValuePropertyAttribute.cs
- FreeFormPanel.cs
- ZipArchive.cs
- ProcessHostMapPath.cs
- XmlTextWriter.cs
- regiisutil.cs
- UpdatePanelTriggerCollection.cs
- BitStream.cs
- GridViewAutomationPeer.cs
- Empty.cs
- XmlSerializationGeneratedCode.cs
- IIS7UserPrincipal.cs
- CommentAction.cs
- TcpAppDomainProtocolHandler.cs
- ContainerParagraph.cs
- WebPartChrome.cs
- WebPartConnectionsConnectVerb.cs
- UserInitiatedNavigationPermission.cs
- DataSourceDescriptorCollection.cs
- TriggerCollection.cs
- AsyncStreamReader.cs
- FileSystemEventArgs.cs
- ProxyElement.cs
- PageVisual.cs
- ReachPageContentCollectionSerializer.cs
- SqlClientWrapperSmiStreamChars.cs
- RadialGradientBrush.cs
- ListChangedEventArgs.cs
- DelegateBodyWriter.cs
- XMLSchema.cs
- RangeValidator.cs
- DataGridViewMethods.cs
- ReadOnlyAttribute.cs
- TextEditorTables.cs
- X509Utils.cs
- ContainerParagraph.cs
- XmlSchemaElement.cs
- TagPrefixInfo.cs
- TextBoxLine.cs
- CompositeDataBoundControl.cs
- DisplayInformation.cs
- QilName.cs
- SimpleBitVector32.cs
- PersonalizableTypeEntry.cs
- TdsParserHelperClasses.cs
- NTAccount.cs
- AttachedPropertiesService.cs
- ListView.cs
- WindowHideOrCloseTracker.cs
- WindowVisualStateTracker.cs
- CodeIdentifier.cs
- AdjustableArrowCap.cs