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
- ColumnCollection.cs
- Camera.cs
- DirectionalLight.cs
- MergeExecutor.cs
- ControlPaint.cs
- FtpRequestCacheValidator.cs
- DataGridColumnStyleMappingNameEditor.cs
- ReadContentAsBinaryHelper.cs
- SerializationSectionGroup.cs
- SqlFactory.cs
- InfocardInteractiveChannelInitializer.cs
- SiteMapHierarchicalDataSourceView.cs
- FlowDocumentReader.cs
- TCEAdapterGenerator.cs
- DataContractSerializer.cs
- CompilerError.cs
- ToolboxItem.cs
- Window.cs
- BatchStream.cs
- DbParameterCollection.cs
- MetaData.cs
- GeometryCombineModeValidation.cs
- DataTrigger.cs
- PropertyDescriptorComparer.cs
- Input.cs
- GeneralTransform3DCollection.cs
- ArgIterator.cs
- IssuedTokenServiceCredential.cs
- KnowledgeBase.cs
- TagNameToTypeMapper.cs
- KeyboardNavigation.cs
- PageContentCollection.cs
- XmlArrayItemAttribute.cs
- UpdatePanelTrigger.cs
- DeriveBytes.cs
- basenumberconverter.cs
- QueryExpr.cs
- ColumnCollection.cs
- Flattener.cs
- XmlSerializerVersionAttribute.cs
- SynchronizedDispatch.cs
- ToolStripTextBox.cs
- ComplexPropertyEntry.cs
- ActivityInstanceReference.cs
- AppLevelCompilationSectionCache.cs
- ConfigXmlText.cs
- DictionaryEntry.cs
- Duration.cs
- DetailsViewUpdateEventArgs.cs
- LZCodec.cs
- PageContentAsyncResult.cs
- UnsupportedPolicyOptionsException.cs
- StateRuntime.cs
- NavigationEventArgs.cs
- XmlRootAttribute.cs
- IODescriptionAttribute.cs
- HttpFileCollection.cs
- EndpointAddressElementBase.cs
- ReadOnlyAttribute.cs
- TypeInitializationException.cs
- IntSecurity.cs
- NameSpaceExtractor.cs
- SafeSystemMetrics.cs
- ResourcePermissionBase.cs
- DataConnectionHelper.cs
- DownloadProgressEventArgs.cs
- TypeLibraryHelper.cs
- UInt16Converter.cs
- CodeIdentifier.cs
- ParameterCollection.cs
- XamlGridLengthSerializer.cs
- ConfigurationManagerHelperFactory.cs
- SmtpMail.cs
- Composition.cs
- InitialServerConnectionReader.cs
- BufferModeSettings.cs
- DelegateCompletionCallbackWrapper.cs
- FontClient.cs
- SetterBaseCollection.cs
- _LocalDataStoreMgr.cs
- FigureParaClient.cs
- ForceCopyBuildProvider.cs
- InfoCardServiceInstallComponent.cs
- PropertyGeneratedEventArgs.cs
- UnmanagedBitmapWrapper.cs
- TableAutomationPeer.cs
- WebPartMenuStyle.cs
- GregorianCalendar.cs
- TdsValueSetter.cs
- RoleManagerModule.cs
- Size3DConverter.cs
- XmlDownloadManager.cs
- IndividualDeviceConfig.cs
- XmlSchemaAppInfo.cs
- InstanceDescriptor.cs
- ProjectedSlot.cs
- CommonDialog.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- ACL.cs
- XmlSerializationGeneratedCode.cs