Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- RotateTransform.cs
- ModelUIElement3D.cs
- BuilderInfo.cs
- KnownBoxes.cs
- XmlAggregates.cs
- Mouse.cs
- ToolStripItemGlyph.cs
- DictionaryBase.cs
- DBSqlParser.cs
- SubclassTypeValidatorAttribute.cs
- IdleTimeoutMonitor.cs
- TextHidden.cs
- SqlProviderManifest.cs
- fixedPageContentExtractor.cs
- OuterGlowBitmapEffect.cs
- StrongNamePublicKeyBlob.cs
- TextInfo.cs
- PipelineModuleStepContainer.cs
- HuffModule.cs
- ImportCatalogPart.cs
- NumericUpDownAccelerationCollection.cs
- ArgumentValidation.cs
- DataGridViewRowPostPaintEventArgs.cs
- CultureInfo.cs
- EncoderParameters.cs
- XhtmlBasicPageAdapter.cs
- WindowsPen.cs
- TcpStreams.cs
- Util.cs
- SqlTypesSchemaImporter.cs
- PassportAuthenticationEventArgs.cs
- ConnectionManagementElementCollection.cs
- EnumerableCollectionView.cs
- CreatingCookieEventArgs.cs
- TypePresenter.xaml.cs
- EncoderExceptionFallback.cs
- TableTextElementCollectionInternal.cs
- UInt16Converter.cs
- ExceptionHandlers.cs
- CodeMethodInvokeExpression.cs
- UnsafeNativeMethods.cs
- DocumentViewerConstants.cs
- Sql8ExpressionRewriter.cs
- ReadOnlyMetadataCollection.cs
- ActivityExecutor.cs
- _BaseOverlappedAsyncResult.cs
- WebPartManager.cs
- srgsitem.cs
- DocumentsTrace.cs
- BaseValidator.cs
- ScrollBar.cs
- SiteMembershipCondition.cs
- ArgIterator.cs
- UnknownBitmapEncoder.cs
- CodeMemberProperty.cs
- DbConnectionPoolGroup.cs
- XmlIncludeAttribute.cs
- StartUpEventArgs.cs
- BuiltInExpr.cs
- RecognizedAudio.cs
- HttpCacheVaryByContentEncodings.cs
- brushes.cs
- SafeSecurityHandles.cs
- GradientBrush.cs
- RepeaterItemCollection.cs
- TimeoutHelper.cs
- SmiGettersStream.cs
- PtsPage.cs
- StateManagedCollection.cs
- CodeAttributeDeclaration.cs
- EmptyStringExpandableObjectConverter.cs
- SiteMapSection.cs
- HtmlControlDesigner.cs
- WebPartTransformerCollection.cs
- XmlnsCompatibleWithAttribute.cs
- TypeLoadException.cs
- controlskin.cs
- SemanticValue.cs
- RpcCryptoContext.cs
- HotCommands.cs
- PixelShader.cs
- DropShadowBitmapEffect.cs
- PropertySourceInfo.cs
- ExpressionCopier.cs
- QilFactory.cs
- ColorTransformHelper.cs
- DrawItemEvent.cs
- BuildProvider.cs
- StringComparer.cs
- LicenseProviderAttribute.cs
- HtmlTextArea.cs
- DbUpdateCommandTree.cs
- ToolStripDropDownClosedEventArgs.cs
- StringArrayEditor.cs
- odbcmetadatacolumnnames.cs
- FieldToken.cs
- SQLRoleProvider.cs
- FixedFindEngine.cs
- ConfigurationSectionGroupCollection.cs
- GatewayDefinition.cs