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
- CustomError.cs
- Console.cs
- CapabilitiesSection.cs
- InvokeMemberBinder.cs
- PropertyCollection.cs
- remotingproxy.cs
- TemplateXamlParser.cs
- MustUnderstandSoapException.cs
- TextCompositionEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- DataBindingHandlerAttribute.cs
- Visual3D.cs
- Span.cs
- XmlEnumAttribute.cs
- CreateRefExpr.cs
- ReferencedAssemblyResolver.cs
- WebColorConverter.cs
- XmlDocumentViewSchema.cs
- FunctionImportMapping.cs
- EdmProperty.cs
- LogManagementAsyncResult.cs
- DefaultValueMapping.cs
- Currency.cs
- EnterpriseServicesHelper.cs
- PromptEventArgs.cs
- ListItemDetailViewAttribute.cs
- TextEmbeddedObject.cs
- Material.cs
- EdmMember.cs
- GridViewItemAutomationPeer.cs
- OdbcUtils.cs
- PropertyEmitter.cs
- RegionIterator.cs
- ObjectHelper.cs
- ProtocolsSection.cs
- WindowsMenu.cs
- AbsoluteQuery.cs
- RuntimeArgument.cs
- CurrencyWrapper.cs
- TextSelectionProcessor.cs
- HwndMouseInputProvider.cs
- RewritingValidator.cs
- CodeStatement.cs
- Image.cs
- WebPartConnectionCollection.cs
- StoreAnnotationsMap.cs
- QueueProcessor.cs
- Serializer.cs
- TextServicesHost.cs
- TagMapInfo.cs
- HistoryEventArgs.cs
- TypedTableBaseExtensions.cs
- NumberSubstitution.cs
- XmlQueryOutput.cs
- CollectionViewGroupInternal.cs
- DataGridTable.cs
- WebSysDisplayNameAttribute.cs
- ListView.cs
- InternalBase.cs
- WorkflowRequestContext.cs
- CodeTypeDelegate.cs
- SchemaImporterExtension.cs
- BStrWrapper.cs
- ComponentEditorForm.cs
- XsdDateTime.cs
- DbConnectionPoolIdentity.cs
- WebControlAdapter.cs
- COAUTHINFO.cs
- StringBlob.cs
- SystemNetHelpers.cs
- QilSortKey.cs
- MailWebEventProvider.cs
- mediaeventshelper.cs
- XsdDateTime.cs
- XmlReflectionImporter.cs
- CroppedBitmap.cs
- MenuItem.cs
- ErasingStroke.cs
- KeyboardDevice.cs
- RequiredAttributeAttribute.cs
- TableHeaderCell.cs
- SettingsBase.cs
- ToolStripRenderer.cs
- NativeRightsManagementAPIsStructures.cs
- Positioning.cs
- TempFiles.cs
- DataServiceProviderWrapper.cs
- Component.cs
- XmlArrayItemAttribute.cs
- EdmComplexTypeAttribute.cs
- WindowsScroll.cs
- CodeDefaultValueExpression.cs
- TypeListConverter.cs
- SchemaEntity.cs
- mediaeventargs.cs
- HttpRequestCacheValidator.cs
- RegexCaptureCollection.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- HotCommands.cs
- util.cs