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
- SettingsBase.cs
- SqlEnums.cs
- ListenerSingletonConnectionReader.cs
- Asn1IntegerConverter.cs
- XPathNodeIterator.cs
- WsdlBuildProvider.cs
- PageClientProxyGenerator.cs
- InternalConfigRoot.cs
- TypeUnloadedException.cs
- DynamicMethod.cs
- MergeFailedEvent.cs
- ModelTreeEnumerator.cs
- ExtensionQuery.cs
- FormsAuthenticationCredentials.cs
- SqlDataSourceQuery.cs
- XmlQueryType.cs
- CellCreator.cs
- SupportingTokenAuthenticatorSpecification.cs
- WebEvents.cs
- ParameterExpression.cs
- KeyGestureValueSerializer.cs
- InputScopeNameConverter.cs
- SettingsPropertyWrongTypeException.cs
- DataObjectSettingDataEventArgs.cs
- SkipQueryOptionExpression.cs
- NavigationPropertySingletonExpression.cs
- SignatureDescription.cs
- WebControlAdapter.cs
- UIElement3D.cs
- SQLBytesStorage.cs
- CodeLinePragma.cs
- XamlInt32CollectionSerializer.cs
- DataMemberConverter.cs
- ClientConfigurationHost.cs
- CrossContextChannel.cs
- NameValueFileSectionHandler.cs
- xmlsaver.cs
- TabControlCancelEvent.cs
- FileRecordSequenceHelper.cs
- SearchForVirtualItemEventArgs.cs
- PersistenceTypeAttribute.cs
- IssuerInformation.cs
- TrustLevel.cs
- WindowsClaimSet.cs
- DesignerActionGlyph.cs
- CodeTypeOfExpression.cs
- SocketElement.cs
- EdmValidator.cs
- XamlLoadErrorInfo.cs
- SystemNetworkInterface.cs
- IPEndPointCollection.cs
- _ConnectionGroup.cs
- UnSafeCharBuffer.cs
- MethodRental.cs
- NullableDoubleSumAggregationOperator.cs
- SerializationInfo.cs
- SessionStateSection.cs
- ProgressBarHighlightConverter.cs
- UnsafePeerToPeerMethods.cs
- CodeObject.cs
- FlowDocumentPageViewerAutomationPeer.cs
- Bidi.cs
- ToolBarButtonDesigner.cs
- FontFamilyConverter.cs
- XmlCharCheckingReader.cs
- DataServiceClientException.cs
- RubberbandSelector.cs
- EntitySetBase.cs
- ScriptingWebServicesSectionGroup.cs
- PerformanceCounterPermissionEntryCollection.cs
- ReadOnlyPropertyMetadata.cs
- WebControl.cs
- UseManagedPresentationElement.cs
- CacheVirtualItemsEvent.cs
- StyleModeStack.cs
- RightsManagementInformation.cs
- SqlCommand.cs
- _SSPISessionCache.cs
- AutomationElementIdentifiers.cs
- DispatchWrapper.cs
- XPathDescendantIterator.cs
- ProcessHostConfigUtils.cs
- CodeComment.cs
- ReturnValue.cs
- SecurityManager.cs
- BitmapCodecInfoInternal.cs
- SelectionWordBreaker.cs
- AnimationStorage.cs
- cache.cs
- DocumentPageViewAutomationPeer.cs
- CellCreator.cs
- EntityFunctions.cs
- XmlSchemaSimpleTypeUnion.cs
- NodeLabelEditEvent.cs
- XmlElementAttribute.cs
- TableLayoutStyle.cs
- ModelItemExtensions.cs
- DetailsView.cs
- MultiTrigger.cs
- SiblingIterators.cs