Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / ResourceReferenceKeyNotFoundException.cs / 1305600 / 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
- securitycriticaldata.cs
- FrameworkPropertyMetadata.cs
- DbProviderManifest.cs
- ComboBox.cs
- DNS.cs
- InputProcessorProfiles.cs
- HttpChannelBindingToken.cs
- MdImport.cs
- ImageField.cs
- RedirectionProxy.cs
- OutputBuffer.cs
- ParamArrayAttribute.cs
- SettingsProperty.cs
- EncoderExceptionFallback.cs
- ExpanderAutomationPeer.cs
- DesignerHelpers.cs
- ChangeConflicts.cs
- RouteUrlExpressionBuilder.cs
- DateTimeStorage.cs
- SrgsSemanticInterpretationTag.cs
- XmlSchemaAny.cs
- XmlHierarchicalEnumerable.cs
- ReferenceList.cs
- Endpoint.cs
- AssociationSet.cs
- LabelEditEvent.cs
- FormViewModeEventArgs.cs
- TextServicesProperty.cs
- CryptoStream.cs
- RouteValueExpressionBuilder.cs
- RectValueSerializer.cs
- CodeTypeOfExpression.cs
- InputLangChangeRequestEvent.cs
- ProfessionalColorTable.cs
- HyperLinkStyle.cs
- FileDialogCustomPlacesCollection.cs
- UiaCoreProviderApi.cs
- TransactionScope.cs
- Terminate.cs
- XPathNodeHelper.cs
- SourceChangedEventArgs.cs
- ISAPIRuntime.cs
- PrinterUnitConvert.cs
- UnSafeCharBuffer.cs
- QilExpression.cs
- MetabaseSettings.cs
- TransformerInfo.cs
- OdbcParameter.cs
- NativeMethods.cs
- QueryFunctions.cs
- recordstate.cs
- FrameworkContentElementAutomationPeer.cs
- EditorZoneBase.cs
- MetafileHeader.cs
- _CommandStream.cs
- ClientTargetCollection.cs
- DataObjectCopyingEventArgs.cs
- RepeaterDesigner.cs
- FromRequest.cs
- ReceiveCompletedEventArgs.cs
- DataSourceCache.cs
- DBDataPermission.cs
- DocumentSignatureManager.cs
- _ListenerResponseStream.cs
- BindingManagerDataErrorEventArgs.cs
- ExceptionHandler.cs
- RegexMatchCollection.cs
- GridViewCellAutomationPeer.cs
- Activator.cs
- CodeTypeDeclarationCollection.cs
- PropertyChangedEventArgs.cs
- EntityDataSourceState.cs
- SpotLight.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SystemIcons.cs
- MsmqBindingBase.cs
- RemotingConfiguration.cs
- translator.cs
- XmlSchemaRedefine.cs
- ActivityDesignerLayoutSerializers.cs
- CopyNamespacesAction.cs
- wgx_render.cs
- OwnerDrawPropertyBag.cs
- ObjectCacheSettings.cs
- ReadOnlyHierarchicalDataSource.cs
- SqlXmlStorage.cs
- JournalNavigationScope.cs
- PeerHopCountAttribute.cs
- RelationshipNavigation.cs
- DocumentSchemaValidator.cs
- EncryptedXml.cs
- ReservationCollection.cs
- MsmqIntegrationSecurityElement.cs
- UnmanagedMemoryStream.cs
- XmlSchemaChoice.cs
- ServiceRoute.cs
- MembershipSection.cs
- MultiByteCodec.cs
- ToolStripDropDownClosingEventArgs.cs
- WindowsToolbar.cs