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
- OuterGlowBitmapEffect.cs
- DataGridSortCommandEventArgs.cs
- SqlDataSourceCache.cs
- AttachedPropertyBrowsableAttribute.cs
- DoubleLinkListEnumerator.cs
- ScrollChrome.cs
- TriState.cs
- ConnectionManagementElement.cs
- URLString.cs
- TypeHelper.cs
- SequenceDesignerAccessibleObject.cs
- HtmlShim.cs
- XmlDownloadManager.cs
- SecurityException.cs
- ToolStripRenderer.cs
- SafeRegistryHandle.cs
- BmpBitmapEncoder.cs
- String.cs
- CodeTypeParameter.cs
- Span.cs
- GridViewDeleteEventArgs.cs
- ConnectionDemuxer.cs
- SqlReferenceCollection.cs
- WebRequestModuleElement.cs
- XmlUtil.cs
- DocumentViewerBase.cs
- BatchWriter.cs
- EditingMode.cs
- Image.cs
- FixedSOMLineRanges.cs
- IconConverter.cs
- DataGridViewCellStyleBuilderDialog.cs
- TransformedBitmap.cs
- ConfigurationSchemaErrors.cs
- ObjectStateFormatter.cs
- SQLByteStorage.cs
- InputDevice.cs
- FileDetails.cs
- CustomLineCap.cs
- CookieParameter.cs
- InkCanvasInnerCanvas.cs
- EventHandlersStore.cs
- SpellCheck.cs
- AutomationPatternInfo.cs
- KeyFrames.cs
- InstallerTypeAttribute.cs
- NotifyCollectionChangedEventArgs.cs
- ExpressionLexer.cs
- ClientScriptManagerWrapper.cs
- ClientConfigPaths.cs
- SystemIPInterfaceProperties.cs
- SchemaCollectionCompiler.cs
- ValidationErrorEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- BinaryUtilClasses.cs
- ShutDownListener.cs
- FontEmbeddingManager.cs
- CodeTypeParameter.cs
- WebPartConnectionsCancelEventArgs.cs
- EventLogException.cs
- PopOutPanel.cs
- PrinterUnitConvert.cs
- RichTextBoxAutomationPeer.cs
- RightNameExpirationInfoPair.cs
- EntityDataSourceMemberPath.cs
- GacUtil.cs
- DragDeltaEventArgs.cs
- NonceCache.cs
- DataGridViewLinkColumn.cs
- CapabilitiesPattern.cs
- SqlDataSourceView.cs
- TypeSemantics.cs
- XsltCompileContext.cs
- OdbcConnection.cs
- TextRange.cs
- GraphicsPath.cs
- DispatcherTimer.cs
- XmlNodeList.cs
- ChineseLunisolarCalendar.cs
- dsa.cs
- SimpleRecyclingCache.cs
- IPEndPoint.cs
- SmtpDateTime.cs
- SupportingTokenSecurityTokenResolver.cs
- DynamicActivityProperty.cs
- EventLog.cs
- UnmanagedMarshal.cs
- PlanCompilerUtil.cs
- xdrvalidator.cs
- CubicEase.cs
- InputScopeAttribute.cs
- CustomError.cs
- WebConfigurationFileMap.cs
- Stylus.cs
- SizeChangedInfo.cs
- RadioButtonPopupAdapter.cs
- GridLengthConverter.cs
- MouseGestureValueSerializer.cs
- StringHandle.cs
- ScrollPatternIdentifiers.cs