Code:
/ 4.0 / 4.0 / 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. /****************************************************************************\ * * 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
- NativeMethods.cs
- ApplicationException.cs
- ClientFormsIdentity.cs
- MessageDescription.cs
- ProjectionNode.cs
- SmtpDateTime.cs
- KnownTypesHelper.cs
- WebPartVerb.cs
- HierarchicalDataTemplate.cs
- ReturnEventArgs.cs
- AgileSafeNativeMemoryHandle.cs
- SourceFileBuildProvider.cs
- Expressions.cs
- codemethodreferenceexpression.cs
- RenderContext.cs
- SQLByteStorage.cs
- KeyTime.cs
- XmlTextWriter.cs
- BitmapEffectInputConnector.cs
- SerializableReadOnlyDictionary.cs
- OpenFileDialog.cs
- HttpRuntimeSection.cs
- MetadataImporterQuotas.cs
- StylusSystemGestureEventArgs.cs
- RealizationDrawingContextWalker.cs
- webclient.cs
- Separator.cs
- TreeViewImageKeyConverter.cs
- WebPartTransformerAttribute.cs
- DataGridViewCellStyle.cs
- TitleStyle.cs
- FixedTextSelectionProcessor.cs
- UnsafeNativeMethods.cs
- LambdaCompiler.Lambda.cs
- ListViewDeletedEventArgs.cs
- SizeFConverter.cs
- XmlSerializer.cs
- List.cs
- HtmlButton.cs
- ListViewDataItem.cs
- EditorZoneBase.cs
- PageAsyncTaskManager.cs
- ControlOperationBehavior.cs
- QuadraticBezierSegment.cs
- CellTreeNodeVisitors.cs
- DefaultValidator.cs
- HostExecutionContextManager.cs
- DrawingImage.cs
- _ListenerAsyncResult.cs
- EmptyControlCollection.cs
- LinkLabel.cs
- SqlRowUpdatingEvent.cs
- PersonalizationStateQuery.cs
- XmlCollation.cs
- DataGridColumnReorderingEventArgs.cs
- Baml2006ReaderSettings.cs
- FormViewModeEventArgs.cs
- TextAnchor.cs
- linebase.cs
- Emitter.cs
- TreeViewEvent.cs
- Stack.cs
- ArrayEditor.cs
- DetailsViewInsertEventArgs.cs
- Stylus.cs
- CharUnicodeInfo.cs
- TreeIterators.cs
- DictationGrammar.cs
- FormatException.cs
- _NestedMultipleAsyncResult.cs
- HtmlDocument.cs
- QilExpression.cs
- SQLMoney.cs
- SqlStream.cs
- SqlDataSourceFilteringEventArgs.cs
- MethodBody.cs
- StylusTip.cs
- DllNotFoundException.cs
- RegexMatch.cs
- PropertyInfoSet.cs
- TextEditorMouse.cs
- SchemaEntity.cs
- SystemParameters.cs
- ApplicationGesture.cs
- CqlQuery.cs
- Variant.cs
- SpeechSynthesizer.cs
- RSAPKCS1KeyExchangeFormatter.cs
- CustomErrorsSectionWrapper.cs
- SqlBulkCopy.cs
- WebPartZoneBase.cs
- EventWaitHandleSecurity.cs
- AdornerLayer.cs
- HotSpotCollection.cs
- DbProviderFactoriesConfigurationHandler.cs
- IProducerConsumerCollection.cs
- WorkflowInstanceExtensionProvider.cs
- WebResponse.cs
- SizeConverter.cs
- propertyentry.cs