Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / ResourceReferenceKeyNotFoundException.cs / 1 / ResourceReferenceKeyNotFoundException.cs
//---------------------------------------------------------------------------- // // File: ResourceReferenceExpression.cs // // Description: // A resource could not be found // // Copyright (C) 2005 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; namespace System.Windows { ///Exception class for resource reference [Serializable] public class ResourceReferenceKeyNotFoundException: InvalidOperationException { ////// Constructor /// public ResourceReferenceKeyNotFoundException() { _resourceKey = null; } ////// Constructor /// public ResourceReferenceKeyNotFoundException(string message, object resourceKey) : base(message) { _resourceKey = resourceKey; } ////// Constructor (required for Xml web service) /// protected ResourceReferenceKeyNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { _resourceKey = info.GetValue("Key", typeof(object)); } ////// LineNumber that the exception occured on. /// public object Key { get { return _resourceKey; } } ////// Populates a SerializationInfo with the data needed to serialize the target object. /// /// /// The SerializationInfo to populate with data. /// /// /// The destination for this serialization. /// ////// Critical: calls Exception.GetObjectData which LinkDemands /// PublicOK: a demand exists here /// [SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("Key", _resourceKey); } private object _resourceKey; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: ResourceReferenceExpression.cs // // Description: // A resource could not be found // // Copyright (C) 2005 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; namespace System.Windows { ///Exception class for resource reference [Serializable] public class ResourceReferenceKeyNotFoundException: InvalidOperationException { ////// Constructor /// public ResourceReferenceKeyNotFoundException() { _resourceKey = null; } ////// Constructor /// public ResourceReferenceKeyNotFoundException(string message, object resourceKey) : base(message) { _resourceKey = resourceKey; } ////// Constructor (required for Xml web service) /// protected ResourceReferenceKeyNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { _resourceKey = info.GetValue("Key", typeof(object)); } ////// LineNumber that the exception occured on. /// public object Key { get { return _resourceKey; } } ////// Populates a SerializationInfo with the data needed to serialize the target object. /// /// /// The SerializationInfo to populate with data. /// /// /// The destination for this serialization. /// ////// Critical: calls Exception.GetObjectData which LinkDemands /// PublicOK: a demand exists here /// [SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("Key", _resourceKey); } private object _resourceKey; } } // 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
- SafeNativeMethods.cs
- TextServicesDisplayAttribute.cs
- WorkflowIdleElement.cs
- SessionIDManager.cs
- ChangeConflicts.cs
- ChtmlFormAdapter.cs
- SqlProcedureAttribute.cs
- ConfigurationElementCollection.cs
- RoutedEvent.cs
- LocatorBase.cs
- QueuePropertyVariants.cs
- PhonemeConverter.cs
- RuleSettings.cs
- ListViewGroupConverter.cs
- DrawingBrush.cs
- WebEvents.cs
- embossbitmapeffect.cs
- LineGeometry.cs
- TableItemPatternIdentifiers.cs
- Point3DCollection.cs
- FontEmbeddingManager.cs
- SemanticResultValue.cs
- PropVariant.cs
- DataSpaceManager.cs
- ElementMarkupObject.cs
- EdmFunctions.cs
- SimpleHandlerBuildProvider.cs
- ScrollBar.cs
- AspProxy.cs
- IODescriptionAttribute.cs
- DataGridViewSortCompareEventArgs.cs
- CounterSetInstance.cs
- SmtpNegotiateAuthenticationModule.cs
- NotSupportedException.cs
- StrokeCollection2.cs
- WebPartHelpVerb.cs
- InheritanceAttribute.cs
- QilFunction.cs
- ConnectionStringsExpressionBuilder.cs
- TypeSystem.cs
- TypeElement.cs
- CodeConstructor.cs
- PropertyOverridesDialog.cs
- MDIWindowDialog.cs
- ArrayElementGridEntry.cs
- FormViewRow.cs
- EventNotify.cs
- grammarelement.cs
- SectionInput.cs
- TableLayoutRowStyleCollection.cs
- NativeMethods.cs
- CompensationDesigner.cs
- ControlCachePolicy.cs
- WebPartConnectionsDisconnectVerb.cs
- InternalCache.cs
- DataConnectionHelper.cs
- HttpApplication.cs
- EventBuilder.cs
- CodeSnippetCompileUnit.cs
- ConvertEvent.cs
- Geometry.cs
- KeyValueSerializer.cs
- ParserStack.cs
- StreamReader.cs
- EFAssociationProvider.cs
- XmlElementList.cs
- GridViewActionList.cs
- SortedDictionary.cs
- WrappedIUnknown.cs
- filewebrequest.cs
- DesignParameter.cs
- VectorConverter.cs
- BamlLocalizableResourceKey.cs
- ITextView.cs
- StylusPointProperty.cs
- MergeFailedEvent.cs
- UncommonField.cs
- BitmapInitialize.cs
- InternalRelationshipCollection.cs
- EdmMember.cs
- PackageRelationship.cs
- ManagementDateTime.cs
- FastEncoder.cs
- StructuredTypeInfo.cs
- Rotation3D.cs
- TreeViewItem.cs
- IRCollection.cs
- QueryExpr.cs
- MessageSmuggler.cs
- Model3D.cs
- TextChange.cs
- IOThreadScheduler.cs
- Task.cs
- HttpHandlerActionCollection.cs
- UrlMappingsModule.cs
- Nullable.cs
- Journal.cs
- Vector3DAnimationBase.cs
- XmlTextReaderImplHelpers.cs
- EntityContainerRelationshipSet.cs