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
- AttributeQuery.cs
- DataConnectionHelper.cs
- WeakRefEnumerator.cs
- listviewsubitemcollectioneditor.cs
- Unit.cs
- ProtocolsConfigurationEntry.cs
- SqlMethodAttribute.cs
- DeclarativeCatalogPart.cs
- KeyNotFoundException.cs
- TreeViewDesigner.cs
- XmlNullResolver.cs
- MonitoringDescriptionAttribute.cs
- BrushValueSerializer.cs
- NullableConverter.cs
- Timeline.cs
- ComPersistableTypeElementCollection.cs
- HttpPostLocalhostServerProtocol.cs
- TypeSystem.cs
- FilteredReadOnlyMetadataCollection.cs
- ExpressionReplacer.cs
- _NativeSSPI.cs
- BasicKeyConstraint.cs
- LoginUtil.cs
- IgnoreSectionHandler.cs
- PathGradientBrush.cs
- ExceptionAggregator.cs
- SslStream.cs
- ProfileGroupSettingsCollection.cs
- UrlMappingCollection.cs
- DataGridDesigner.cs
- BitmapCodecInfoInternal.cs
- TextAutomationPeer.cs
- TerminatorSinks.cs
- ConfigurationManagerInternal.cs
- IChannel.cs
- DocumentGridContextMenu.cs
- PolyLineSegmentFigureLogic.cs
- ReflectEventDescriptor.cs
- RepeaterCommandEventArgs.cs
- PersonalizationDictionary.cs
- ConnectionManagementSection.cs
- FilterException.cs
- TextSpanModifier.cs
- MembershipPasswordException.cs
- XmlWellformedWriterHelpers.cs
- TextChangedEventArgs.cs
- XmlReflectionImporter.cs
- TextRangeProviderWrapper.cs
- Point3DConverter.cs
- OdbcCommand.cs
- RepeaterItemEventArgs.cs
- DialogResultConverter.cs
- RangeValueProviderWrapper.cs
- shaperfactory.cs
- NonParentingControl.cs
- DataTableNewRowEvent.cs
- CapacityStreamGeometryContext.cs
- SetterTriggerConditionValueConverter.cs
- ServiceSecurityAuditBehavior.cs
- ColumnResult.cs
- BuildProviderCollection.cs
- MasterPageCodeDomTreeGenerator.cs
- PageContentCollection.cs
- OleDbCommand.cs
- DataServiceHost.cs
- BCryptHashAlgorithm.cs
- LineSegment.cs
- ObservableCollection.cs
- TriggerBase.cs
- StrongNameKeyPair.cs
- HitTestDrawingContextWalker.cs
- TypeConverterHelper.cs
- InternalDispatchObject.cs
- JournalNavigationScope.cs
- FrameworkObject.cs
- HttpCachePolicyBase.cs
- XmlExpressionDumper.cs
- TextDecorationCollection.cs
- OrthographicCamera.cs
- ComponentChangingEvent.cs
- CodeThrowExceptionStatement.cs
- UnauthorizedAccessException.cs
- DocumentApplication.cs
- AssemblySettingAttributes.cs
- PartitionerQueryOperator.cs
- HitTestWithPointDrawingContextWalker.cs
- FrugalMap.cs
- TableLayoutStyle.cs
- DeviceContext2.cs
- Query.cs
- TableLayoutCellPaintEventArgs.cs
- EpmSourcePathSegment.cs
- SelectionItemPattern.cs
- ComponentGlyph.cs
- TreeViewCancelEvent.cs
- DbConnectionPoolIdentity.cs
- NetworkStream.cs
- StatusBarItemAutomationPeer.cs
- ResourceContainer.cs
- AutoGeneratedField.cs