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
- CfgArc.cs
- IdnMapping.cs
- RootBrowserWindow.cs
- InvalidAsynchronousStateException.cs
- QueryResult.cs
- XmlSchemaComplexContentRestriction.cs
- PipelineModuleStepContainer.cs
- SecurityRuntime.cs
- PolicyManager.cs
- _TimerThread.cs
- CodeArrayIndexerExpression.cs
- ContextBase.cs
- HttpCookie.cs
- DataAdapter.cs
- ListViewPagedDataSource.cs
- ExpressionBindings.cs
- ForceCopyBuildProvider.cs
- CultureTable.cs
- FrameDimension.cs
- OlePropertyStructs.cs
- WebExceptionStatus.cs
- PropertyManager.cs
- EncoderReplacementFallback.cs
- Argument.cs
- ProtectedProviderSettings.cs
- MDIClient.cs
- WebPartConnectionsCancelEventArgs.cs
- ConfigurationSectionGroup.cs
- DurableOperationContext.cs
- ListBox.cs
- CFStream.cs
- HtmlWindowCollection.cs
- MarkupCompilePass1.cs
- WebPartDeleteVerb.cs
- StringKeyFrameCollection.cs
- MembershipSection.cs
- ObjectStateManagerMetadata.cs
- SelectorAutomationPeer.cs
- ItemCollection.cs
- EllipseGeometry.cs
- RadialGradientBrush.cs
- ExpressionVisitor.cs
- UrlAuthFailureHandler.cs
- ZoneIdentityPermission.cs
- Number.cs
- EntityCommandDefinition.cs
- RenderContext.cs
- X509Certificate2.cs
- OSFeature.cs
- CopyAction.cs
- NativeMethodsCLR.cs
- SQLInt16.cs
- LassoHelper.cs
- AvTraceFormat.cs
- MenuStrip.cs
- XmlSiteMapProvider.cs
- MinimizableAttributeTypeConverter.cs
- RowUpdatedEventArgs.cs
- ValidatorCompatibilityHelper.cs
- UiaCoreProviderApi.cs
- GPStream.cs
- Variable.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- safelinkcollection.cs
- HtmlTernaryTree.cs
- ImageButton.cs
- ClientData.cs
- PersonalizationStateQuery.cs
- AffineTransform3D.cs
- InfoCardServiceInstallComponent.cs
- MethodToken.cs
- DbConnectionFactory.cs
- Trace.cs
- HttpWebResponse.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- BinarySerializer.cs
- LineInfo.cs
- SyndicationContent.cs
- SerialPinChanges.cs
- TypeDescriptionProviderAttribute.cs
- OperationCanceledException.cs
- SurrogateSelector.cs
- CharacterMetricsDictionary.cs
- BaseTransportHeaders.cs
- XmlTextReader.cs
- DataTrigger.cs
- ArglessEventHandlerProxy.cs
- Transactions.cs
- NotifyInputEventArgs.cs
- ObjectSet.cs
- GridViewCommandEventArgs.cs
- TriggerAction.cs
- TextBoxBase.cs
- ChangeNode.cs
- DataListComponentEditor.cs
- GregorianCalendar.cs
- TypePropertyEditor.cs
- WebZone.cs
- XmlChildNodes.cs
- SqlDataSourceQueryEditorForm.cs