Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Markup / BamlRecordHelper.cs / 1 / 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
- EntityObject.cs
- DbConnectionPoolIdentity.cs
- TextElementEditingBehaviorAttribute.cs
- DelayedRegex.cs
- InstanceCreationEditor.cs
- TypeGeneratedEventArgs.cs
- Column.cs
- SecurityTokenTypes.cs
- storepermissionattribute.cs
- EventLogRecord.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- RelationshipEndMember.cs
- HScrollProperties.cs
- FixedSOMTextRun.cs
- DbException.cs
- Triangle.cs
- WebPartPersonalization.cs
- SecUtil.cs
- XsltCompileContext.cs
- CodeAccessPermission.cs
- StorageMappingItemLoader.cs
- TriggerAction.cs
- storepermissionattribute.cs
- FileDetails.cs
- DataGridViewTopRowAccessibleObject.cs
- Reference.cs
- Attributes.cs
- COM2PictureConverter.cs
- SafeHandles.cs
- Filter.cs
- Cloud.cs
- StandardRuntimeEnumValidator.cs
- ConnectionsZone.cs
- ListViewInsertEventArgs.cs
- IEnumerable.cs
- _CommandStream.cs
- DiscriminatorMap.cs
- DataTableNewRowEvent.cs
- WebBrowserProgressChangedEventHandler.cs
- StringArrayConverter.cs
- DetailsViewRowCollection.cs
- DataGridViewButtonCell.cs
- HostedTransportConfigurationBase.cs
- DbDeleteCommandTree.cs
- BaseInfoTable.cs
- TileBrush.cs
- XMLDiffLoader.cs
- Literal.cs
- SpStreamWrapper.cs
- SecondaryViewProvider.cs
- ExpandSegment.cs
- ReadOnlyDataSource.cs
- oledbmetadatacollectionnames.cs
- WindowsFormsHostPropertyMap.cs
- DuplicateDetector.cs
- webbrowsersite.cs
- ResourceWriter.cs
- VariantWrapper.cs
- SqlOuterApplyReducer.cs
- Command.cs
- SqlXml.cs
- FixedDocumentSequencePaginator.cs
- PasswordPropertyTextAttribute.cs
- Matrix3DValueSerializer.cs
- CollectionViewSource.cs
- HeaderUtility.cs
- DynamicDocumentPaginator.cs
- HyperLinkStyle.cs
- HtmlProps.cs
- EntityTypeEmitter.cs
- FileDialogCustomPlacesCollection.cs
- XPathEmptyIterator.cs
- M3DUtil.cs
- ZipIOCentralDirectoryBlock.cs
- StreamUpgradeAcceptor.cs
- HtmlContainerControl.cs
- UrlMappingsSection.cs
- HebrewCalendar.cs
- QilSortKey.cs
- ToolStripPanelCell.cs
- ArrayListCollectionBase.cs
- HexParser.cs
- GenericsInstances.cs
- MappingException.cs
- ResolveDuplexCD1AsyncResult.cs
- XmlSchemaProviderAttribute.cs
- ContextStaticAttribute.cs
- InvalidOleVariantTypeException.cs
- XPathChildIterator.cs
- EntityContainerEmitter.cs
- Line.cs
- ObjectSecurity.cs
- WebPartMovingEventArgs.cs
- WebPartCloseVerb.cs
- Enum.cs
- SHA1Cng.cs
- Drawing.cs
- HierarchicalDataBoundControl.cs
- TextRange.cs
- WindowsGraphicsWrapper.cs