Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / ObjectLayer / LoadMessageLogger.cs / 1305376 / LoadMessageLogger.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.Data.Entity; namespace System.Data.Metadata.Edm { internal class LoadMessageLogger { private Action_logLoadMessage; private Dictionary _messages = new Dictionary (); internal LoadMessageLogger(Action logLoadMessage) { this._logLoadMessage = logLoadMessage; } internal void LogLoadMessage(string message, EdmType relatedType) { if (_logLoadMessage != null) { _logLoadMessage(message); } LogMessagesWithTypeInfo(message, relatedType); } internal string CreateErrorMessageWithTypeSpecificLoadLogs(string errorMessage, EdmType relatedType) { return new StringBuilder(errorMessage) .AppendLine(this.GetTypeRelatedLogMessage(relatedType)).ToString(); } private string GetTypeRelatedLogMessage(EdmType relatedType) { Debug.Assert(relatedType != null, "have to pass in a type to get the message"); if (this._messages.ContainsKey(relatedType)) { return new StringBuilder() .AppendLine() .AppendLine(Strings.ExtraInfo) .AppendLine(this._messages[relatedType].ToString()).ToString(); } else { return string.Empty; } } private void LogMessagesWithTypeInfo(string message, EdmType relatedType) { Debug.Assert(relatedType != null, "have to have a type with this message"); if (this._messages.ContainsKey(relatedType)) { // if this type already contains loading message, append the new message to the end this._messages[relatedType].AppendLine(message); } else { this._messages.Add(relatedType, new StringBuilder(message)); } } } } // 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
- SafeSecurityHandles.cs
- TextContainerHelper.cs
- ListControlConvertEventArgs.cs
- HelpKeywordAttribute.cs
- Hash.cs
- SelectorItemAutomationPeer.cs
- ImageDrawing.cs
- DataServiceRequest.cs
- ProjectedSlot.cs
- Variable.cs
- BinaryMethodMessage.cs
- GridViewCancelEditEventArgs.cs
- MenuRenderer.cs
- LinkArea.cs
- NativeMethods.cs
- Internal.cs
- Line.cs
- SafeEventLogWriteHandle.cs
- _NativeSSPI.cs
- GeneralTransformCollection.cs
- ElementHostPropertyMap.cs
- XmlSerializableReader.cs
- WebResourceUtil.cs
- DbConnectionStringCommon.cs
- DrawingCollection.cs
- WebPartsPersonalization.cs
- UniqueContractNameValidationBehavior.cs
- RectIndependentAnimationStorage.cs
- PriorityBinding.cs
- AstNode.cs
- CompositeFontParser.cs
- Avt.cs
- ServiceProviders.cs
- WindowsUpDown.cs
- FixedTextBuilder.cs
- AutomationProperty.cs
- CodeCatchClause.cs
- UserUseLicenseDictionaryLoader.cs
- DSGeneratorProblem.cs
- RequestUriProcessor.cs
- CodePageUtils.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- CollectionViewProxy.cs
- TableLayoutPanelCellPosition.cs
- SchemaCollectionCompiler.cs
- RegionIterator.cs
- Panel.cs
- ConstraintEnumerator.cs
- LoginName.cs
- CustomPopupPlacement.cs
- NamespaceCollection.cs
- FontDriver.cs
- DynamicDiscoSearcher.cs
- ResourceBinder.cs
- SQLInt32Storage.cs
- StagingAreaInputItem.cs
- ToolboxItemCollection.cs
- SecurityAlgorithmSuite.cs
- _OverlappedAsyncResult.cs
- TcpStreams.cs
- ReadOnlyDictionary.cs
- SecurityTokenProvider.cs
- _ListenerRequestStream.cs
- ContractsBCL.cs
- DesignerActionItemCollection.cs
- UnhandledExceptionEventArgs.cs
- RoleBoolean.cs
- FormatSettings.cs
- ArcSegment.cs
- TabletDevice.cs
- TargetException.cs
- InkSerializer.cs
- SiteMapPath.cs
- CallbackValidatorAttribute.cs
- DomainUpDown.cs
- RTLAwareMessageBox.cs
- ParameterElementCollection.cs
- RegexTypeEditor.cs
- UnsafeNativeMethods.cs
- OleDbSchemaGuid.cs
- StaticContext.cs
- HtmlSelect.cs
- WorkflowOperationBehavior.cs
- TableColumn.cs
- Color.cs
- IsolationInterop.cs
- ProxyHwnd.cs
- ChangeInterceptorAttribute.cs
- OptimisticConcurrencyException.cs
- EventSchemaTraceListener.cs
- VectorKeyFrameCollection.cs
- AdornerDecorator.cs
- PageAdapter.cs
- CheckedPointers.cs
- SimpleWebHandlerParser.cs
- ServerValidateEventArgs.cs
- UnaryExpressionHelper.cs
- SafeEventHandle.cs
- LinkClickEvent.cs
- TcpChannelHelper.cs