Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / CompMod / System / ComponentModel / Design / Serialization / CodeDomSerializerException.cs / 1 / CodeDomSerializerException.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel.Design.Serialization { using System; using System.CodeDom; using System.Runtime.Serialization; ////// /// [Serializable] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")] public class CodeDomSerializerException : SystemException { private CodeLinePragma linePragma; ///The exception that is thrown when the code dom serializer experiences an error. /// ////// /// public CodeDomSerializerException(string message, CodeLinePragma linePragma) : base(message) { this.linePragma = linePragma; } ///Initializes a new instance of the CodeDomSerializerException class. ////// /// public CodeDomSerializerException(Exception ex, CodeLinePragma linePragma) : base(ex.Message, ex) { this.linePragma = linePragma; } ///Initializes a new instance of the CodeDomSerializerException class. ////// /// public CodeDomSerializerException(string message, IDesignerSerializationManager manager) : base(message) { FillLinePragmaFromContext(manager); } ///Initializes a new instance of the CodeDomSerializerException class. ////// /// public CodeDomSerializerException(Exception ex, IDesignerSerializationManager manager) : base(ex.Message, ex) { FillLinePragmaFromContext(manager); } ///Initializes a new instance of the CodeDomSerializerException class. ///protected CodeDomSerializerException(SerializationInfo info, StreamingContext context) : base (info, context) { linePragma = (CodeLinePragma)info.GetValue("linePragma", typeof(CodeLinePragma)); } /// /// /// public CodeLinePragma LinePragma { get { return linePragma; } } ///Gets the line pragma object that is related to this error. ////// Sniffs around in the context looking for a code statement. if it finds one, it will add the statement's /// line # information to the exception. /// private void FillLinePragmaFromContext(IDesignerSerializationManager manager) { if (manager == null) throw new ArgumentNullException("manager"); CodeStatement statement = (CodeStatement)manager.Context[typeof(CodeStatement)]; CodeLinePragma linePragma = null; if (statement != null) { linePragma = statement.LinePragma; } } ///public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { throw new ArgumentNullException("info"); } info.AddValue("linePragma", linePragma); base.GetObjectData(info, context); } } } // 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
- SecurityTokenSerializer.cs
- ScriptResourceAttribute.cs
- xmlformatgeneratorstatics.cs
- EdmTypeAttribute.cs
- FieldTemplateUserControl.cs
- ValidationPropertyAttribute.cs
- SqlDataSourceConfigureSelectPanel.cs
- BaseCollection.cs
- InitialServerConnectionReader.cs
- StyleSelector.cs
- DataColumnPropertyDescriptor.cs
- XmlKeywords.cs
- CounterSample.cs
- ScrollItemPattern.cs
- ClassGenerator.cs
- Boolean.cs
- XPathSingletonIterator.cs
- TypeGeneratedEventArgs.cs
- StopStoryboard.cs
- WeakReferenceKey.cs
- TabItemWrapperAutomationPeer.cs
- CacheVirtualItemsEvent.cs
- PackageRelationshipSelector.cs
- FileUtil.cs
- ObjectListField.cs
- ObjectConverter.cs
- _ListenerResponseStream.cs
- TextTreeInsertUndoUnit.cs
- AttributeProviderAttribute.cs
- SqlDeflator.cs
- TemplateControlBuildProvider.cs
- KeyBinding.cs
- AffineTransform3D.cs
- RichTextBox.cs
- DataSvcMapFileSerializer.cs
- ResXBuildProvider.cs
- GPRECT.cs
- FontSourceCollection.cs
- MultiView.cs
- ListBoxItemWrapperAutomationPeer.cs
- GPPOINTF.cs
- DataSourceCacheDurationConverter.cs
- MembershipPasswordException.cs
- TraceListeners.cs
- ImmutableObjectAttribute.cs
- RtType.cs
- TypedServiceOperationListItem.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- DrawingVisualDrawingContext.cs
- ProgressBarRenderer.cs
- CustomWebEventKey.cs
- ListBindableAttribute.cs
- Boolean.cs
- TextCollapsingProperties.cs
- ThreadInterruptedException.cs
- ActivityLocationReferenceEnvironment.cs
- SoapReflectionImporter.cs
- SelectionEditingBehavior.cs
- ShimAsPublicXamlType.cs
- WriteableOnDemandPackagePart.cs
- ColumnClickEvent.cs
- SqlErrorCollection.cs
- HandlerBase.cs
- BitmapSource.cs
- TextTreePropertyUndoUnit.cs
- DropSource.cs
- TextEffect.cs
- BlobPersonalizationState.cs
- VsPropertyGrid.cs
- Scheduler.cs
- AppDomainProtocolHandler.cs
- SortableBindingList.cs
- PageCache.cs
- BooleanStorage.cs
- MiniConstructorInfo.cs
- BitmapSizeOptions.cs
- Byte.cs
- SqlParameterCollection.cs
- ArrayWithOffset.cs
- ThousandthOfEmRealDoubles.cs
- SystemWebCachingSectionGroup.cs
- ProcessModelSection.cs
- SafeProcessHandle.cs
- SaveFileDialog.cs
- SqlRowUpdatingEvent.cs
- DBPropSet.cs
- PLINQETWProvider.cs
- XmlSchemaImporter.cs
- FastEncoderWindow.cs
- Internal.cs
- InfoCardClaim.cs
- RelationshipType.cs
- FlowLayoutPanel.cs
- AccessKeyManager.cs
- GuidConverter.cs
- ISAPIRuntime.cs
- WebUtility.cs
- ExpressionNode.cs
- ConfigurationValues.cs
- SqlFunctions.cs